LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the DB Tools Select Data VI with MS Access?

OK, I can now successfully insert data into a MS Access database. I'm now having trouble reading the data back.

What I would really like is a VI which returns the maximum value of a long integer in one column. (This is the auto-number column.)

The only VI I can find so far which will extract data is in CONTROLS ARRAY&CLUSTER VARIANT. This allows me to read the data, all the entries in one column, on the front panel. But then I want to get one value from the data (the latest entry, or maximum value in the column). I then need to write this value back into another table (so as to maintain database relationships). And I can't find a way to do it.
0 Kudos
Message 1 of 3
(3,245 Views)
This is when u need to know the SQL query because this requires advance searching and not just pulling data out of Access.
Assume that id auto number column in my table. If i need the MAX value of id, then i could use query like

SELECT Max(id) FROM DZ;

For that i will not use the SELECT VI, instead you would use, EXECUTE QUERY, FETCH RECORDSET DATA and FREE OBJECT VI.
For more detail help on queries, consult the DB Tools user manual on our website.
Hope this would help

A Rafiq
National Instruments
0 Kudos
Message 2 of 3
(3,245 Views)
I found a different (and easier for me) way to do it - see your answer to my other query.
0 Kudos
Message 3 of 3
(3,245 Views)