Configure a Microsoft Data Link file (UDL) for Use With LabVIEW Database Connectivity Toolkit

Updated Dec 7, 2020

Environment

Software

  • LabVIEW
  • LabVIEW Database Connectivity Toolkit

Operating System

  • Windows

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.

This tutorial walks you through how to create a Microsoft Data Link file with a .udl extension so that you can access a Microsoft Access database from LabVIEW. For questions regarding Microsoft Access or databases, research Microsoft support documentation.

Create a UDL File

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 survey your options:
    1. If available, select Microsoft Data Link. This is not present in all versions of Windows
      • If Microsoft Data Link was selected, your UDL file is created. 
    2. If Microsoft Data Link is not available, select Text Document
  3. Give the document any name with a .udl extension
    • A window may 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.
 

Link to Microsoft Acess Database

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. 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.
    • At this point, you can close Access (just remember where you saved the database).
  3. 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).
  4. 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. 


         
  5. 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.