Create a DSN to Use With the LabVIEW Database Connectivity Toolkit

Updated Jul 1, 2024

Environment

Software

  • LabVIEW Database Connectivity Toolkit

This article provides general guidelines for creating a Data Source Name (DSN) for use with the LabVIEW Database Connectivity Toolkit. The steps below will use a Microsoft Access database as an example, if using a different database provider, the configuration might need additional configuration settings after selecting the driver to be used. For more information on connecting to an ODBC data source, refer to the Microsoft documentation.

User or System DSN

  1. Navigate to Control Panel>>Administrative Tools>>ODBC Data Sources (32-Bit) or ODBC Data Sources (64-Bit), depending on the bitness of LabVIEW and the database provider/driver you are using. In older versions of Windows, this may be listed as Data Sources (ODBC).
  2. Select either the User DSN or System DSN tab.
  3. Select Add>>Microsoft Access Driver (*.mdb, *.accdb)>>Finish.
  4. Give it a Data Source Name and a description.
  5. Choose the Select button in the Database field.
  6. Navigate to the location of your Access database and select OK.
  7. Select OK on the ODBC Microsoft Access Setup window.
  8. You should now see your DSN in the User/System Data Source window.



File DSN

  1. Navigate to Control Panel>>Administrative Tools>>ODBC Data Sources (32-Bit) or ODBC Data Sources (64-Bit), depending on the bitness of LabVIEW and the database provider/driver you are using. In older versions of Windows, this may be listed as Data Sources (ODBC).
  2. Select the File DSN tab.
  3. Select Add>>Microsoft Access Driver (*.mdb, *.accdb)>>Next.
  4. Navigate to the DSN file you wish to use via the Browse button (the name of the file should have a .dsn file extension), or manually type in the file path. 
  5. Select Next>>Finish.
  6. Choose the Select button in the Database field.
  7. Navigate to the location of your Access database and select OK.
  8. Select OK on the ODBC Microsoft Access Setup window.
  9. Select OK on the ODBC Data Source Administrator window.
  10. The DSN file should now be located in the location you specified in step 4.

 


Using the DSN in LabVIEW

You will now have created a DSN that can be used by the DB Tools Open Connection VI from the LabVIEW Database Connectivity Toolkit. If you created a File DSN you can connect a file path value to the DB Tools Open Connection VI and point it to the file, if you created a System or User DSN you can use a string value specifying the name as configured in the Windows ODBC Administrator.

dsnoptions.png