Virus scan in progress. Please wait to download attachments.
This example demonstrates how to query the column headers together with the content of the columns from a database.
The Database Connectivity Toolkit offers multiple ways to query the content of a database table. You can use the DB Tools Select Data VI or the DB Tools Execute Query VI to get the content of a database table.
Both functions return the content of the table, but not the name of the corresponding columns. It is possible to get the column names with a SQL Query, but this query is different for each Database Management System (DBMS).
This example will push a test table named TestTable with some test data into LabVIEW.mdb. The Rec GetData VI (<labview>\addons\database\Recordset.llb\Rec GetData.vi) is used afterwards to get a reference to the recordset which offers a name property which provides the column names.
LabVIEW Base Development System 2012 (or compatible)
Note: You cannot use this example on RT targets. The Database Connectivity Toolkit uses ActiveX to access the database. ActiveX is a Windows only technology and not available on RT targets.
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.