You are on page 1of 4

Creating a Microsoft Data Link file (UDL) for Connecting to a Databas... https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000...

Home ❯ Support ❯ Creating a Microsoft Data Link file (UDL) for Connecting to a Database in LabVIEW

Este conteúdo não está disponível em seu idioma preferido.


O conteúdo é exibido em outro idioma disponível. Seu navegador pode incluir recursos que podem
ajudar a traduzir o texto.

Updated Dec 5, 2019

LabVIEW Windows
LabVIEW Database Connectivity Toolkit

The Database Connectivity Toolkit in LabVIEW requires a Microsoft Data Link file (UDL) to interface with a Microsoft
Access database. UDL files can also be used to connect with other database types, such as SQL. How do I create a
Microsoft Data Link file with a .udl extension in order to do this?

The way a UDL file is initially created depends on your Windows installation. This can be checked from the Folder
shortcut menu.
1. Right-click on the Desktop or in the folder where you want to create the file.
2. Select New, then Text Document (or Microsoft Data Link if you have that option)
1. If Microsoft Data Link was selected, your UDL file is created.
3. Give the Text Document any name with a .udl extension ("Show file extensions" must be enabled in folder
options).
4. A window will pop up warning that "If you change a filename extension, the file may become unusable. Are you
sure you want to change it?" Select Yes.

Once you have a Microsoft Data Link file, you need to link the UDL file to an Access database to use it with your
application.

1 of 4 08/02/2020 09:19
Creating a Microsoft Data Link file (UDL) for Connecting to a Databas... https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000...

1. Open Access. Select Blank Access Database, and click OK.


2. In the File New Database window, save the Database in a location of your choice with any .mdb or .accdb
extension name.
3. At this point you can close Access (just remember where you saved the database).
4. Go back to the UDL file that was created previously and double-click it (this is where a link to the Access
database is created).
5. Click the Provider tab. For .mdb files, select Microsoft Jet 4.0 OLE DB Provider. For .accdb files,
select Microsoft Office 12.0 Access Database Engine OLE DB Provider.
NOTE: If you are using a 64 bit Windows operating system, the provider tab will not show the Microsoft Jet 4.0
OLE DB Provider or Microsoft Office 12.0 Access Database Engine OLE DB Provider. This is because they are
32 bit database providers. To make 32 bit providers display in the Provider tab, follow these steps:
1. Navigate to Start>>All Programs>>Accessories>>Command Prompt
2. Type the following command: C:\Windows\syswow64\rundll32.exe "C:\Program Files
(x86)\Common Files\System\Ole DB\oledb32.dll",
OpenDSLFile C:\test.udl, where C:\test.udl is the file path to the UDL file you have created. This
will open the UDL file.
3. Click the Provider tab, the 32 bit database providers should now show.

6. Click the Connection tab. Navigate to the .mdb or .accdb Access Database that was created in step 2. Now,
the UDL file is ready to be used in LabVIEW. You can also use a relative path to the UDL file if you will be
moving files and don't want to manually edit the UDL file each time you move the files.

2 of 4 08/02/2020 09:19
Creating a Microsoft Data Link file (UDL) for Connecting to a Databas... https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000...

If you see an error that reads Provider cannot be found. Ensure that the provider has been installed properly, you
can try opening the file manually and editing its contents to work with your database.

1. Right click on your UDL file and select Open With>>Notepad.


2. Write the contents of your UDL file without using the Microsoft Data Link Configuration Tool.
3. You can use the following resource to understand the file syntax. External Link: The Connection Strings
Reference.

Here is an example to open a .accdb file without authentication:

3 of 4 08/02/2020 09:19
Creating a Microsoft Data Link file (UDL) for Connecting to a Databas... https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000...

[oledb]
; Everything after this line is an OLE DB initstring
Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=C:\Users\Public\Documents\Database.accdb;
Persist Security Info=False;

Where Data Source is the path to the database.

How to Create a DSN File to Communicate with an Collaborate with other users in our discussion forums
Access Database in LabVIEW Search the NI Community for a solution

ADO Error 0x00000001 or 0x80040E14 When


Writing Data to Access Database

Database Connectivity Error -2147467259 or


-21468245984 With LabVIEW Application A valid service agreement may be required, and
support options vary by country.
LabVIEW Error -2147217900 When Inserting Data Open a service Purchase or renew
Into an Access Database request support services

External Link: Download Microsoft Access Database


Engine 2010 Redistributable from Official Microsoft
Download Center

External Link: Connecting to Microsoft Access

4 of 4 08/02/2020 09:19

You might also like