Labview Database Connectivity Error When Trying to Connect to a Database

Updated Aug 17, 2023

Reported In

Software

  • LabVIEW Database Connectivity Toolkit
  • LabVIEW

Issue Details

I have a LabVIEW application that uses the LabVIEW Database Connectivity Toolkit to access a local database file (.mdb) created using Microsoft Access. When I tried to run the application, I get the following error messages.
  • Error -2147467259 occured at NI_Database_API.lvlib:DB Tools Open Connec(String).vi->Untitled 1
  • Error -2146824584 Occured at Untitled 1

 
  • Error -2147287038 Occured at Untitled 1
image.png
  • Database Connectiviy Issues. Please Contact Admin. Software to be Exit now.

Solution

The error messages suggest that LabVIEW is not able to connect to the database server and the Open Database Connectivity (ODBC) is either not configured or configured incorrectly. 

To access a database from other applications, you need to specify a Data Source name (DSN) or Microsoft Data Link file (.udl).

In LabVIEW, the LabVIEW Database Connectivity Toolkit allows you to use either of the following methods:

Instead of specifying a DSN or UDL file, you can also access a database by passing a connection strings to the DB Tool Connection.vi. Please refer to the (external link) connection strings reference guide for the specific connection string for each database type. 

Additional Information

When connecting to a database in LabVIEW using DSN file, the connection string needs to be the same as specified in the ODBC Data Source Administrator.