Example Code

Connect Directly to a Microsoft Access Database Using Connection String

Code and Documents

Attachment

With the LabVIEW Enterprise Connectivity Toolkit, you can access many different types of databases using the appropriate Microsoft ActiveX Data Object (ADO)-compliant OLE-DB or ODBC driver.

One database is the Microsoft Access database. You can connect to an Access database using the Microsoft Jet OLEDB driver.

Usually you can set up the connection by creating a Universal Data Link (.udl) file and inputting the path to the DB Tools Open Connec VI in the LabVIEW Enterprise Connectivity Toolkit. However, you also can connect to a database directly without setting up a UDL file. This example demonstrates how to use connection strings to set the provider for the database. Because connection strings can be difficult to use and using a UDL file offers more control over the type of access to the database, using the UDL file is recommended.

Related Links:
 
KB 3OSAJHTJ: Programmatically Creating Universal Data Link (*.udl / UDL) Files
KB 2E7GIDDT: What Is the Difference between a System DSN, a User DSN, and a File DSN?

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors