LabVIEW Database Connectivity Error When Trying to Connect to a Database

Updated Jun 27, 2024

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). Follow the next steps to try to solve this issue:

  • Check Microsoft ODBC Data Source Administrator to verify that you can see a connection to your database. 
  • Verify that the ODC connection is configured in the data source with the same bitness as the LabVIEW version you are using.
Note: 64-bit support for the LabVIEW Database Connectivity Toolkit was added in LabVIEW 2019, if you are using an older version, make sure the ODBC connection data source is configured in 32-bit.

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.