LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DataBase Help

I am using Access 2002 with Labview. I can move through one table using the Connectivity Tool kit but am having troubles with a sub table. In access, I have set the links between the tables.

How do I using get the data from the second table that is linked to the first?

Attached is my database for example. In access you can see the links and drill down from the tests table to the details table.

Thank you,
Paul
Download All
0 Kudos
Message 1 of 3
(2,634 Views)
You need to do a join. For example, if you wanted all Voltages from Details, the SQL query would be "Select Details.Voltages FROM Tests INNER JOIN Details ON Tests.PN = Details.PN.

If you design a query in Access, you can select SQL VIEW from the VIEW menu. This is how I debugged all of my queries when was using Access.
0 Kudos
Message 2 of 3
(2,634 Views)
In addition, if you were to use the DB Tools Select Data.VI, you could hack it to take this query and process. To do this, insert "Details.Voltage" for the Columns terminal String Array, and "Tests INNER JOIN Details ON Tests.PN = Details.PN" for the Table terminal String Constant. If you probe the SQL query inside of Select Data just before Execute Query, you'll see that the SQL query will look exactly like the one Dennis offered. If you prefer not to use this VI, then go to the Advanced Palette, and use the Execute Query, Fetch ALL, and Free Recordset VIs to get the data, which is essentially what Select Data is doing.

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 3 of 3
(2,634 Views)