LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sql query across multiple tables ina database

Highlighted

I have 3 MS Access tables in database that are linked by keyed fields in the table.  Is there a way to fetch only certain records that match a criteria across all three of these tables using the database connectivity toolset VIs?

0 Kudos
Message 1 of 5
(1,156 Views)
Highlighted
Yes. Search for the use of joins in SQL query. Also, Access has a query wizard that can then display the SQL syntax. I haven't used Access on years, though and I don't remember which menu option that is.
0 Kudos
Message 2 of 5
(1,150 Views)
Highlighted

Thanks.  I am trying to mechanize/run an SQL query like this 

 

SELECT Code_Type.Code_NUM, Code_Type.Code_Word, Word_Type.Parm_Label, Word_Type.Word_Sequence, Word_Type.Num_Words, Parameter_Label.Parm_Label, Parameter_Label.Parm_Name, Parameter_Label.Num_Bits, Parameter_Label.Num_Bits
FROM (Code_Type INNER JOIN Word_Type ON Code_Type.Code_Word = Word_Type.Code_Word) INNER JOIN Parameter_Label ON Word_Type.Parm_Label = Parameter_Label.Parm_Label;

 

 

while using the VIs in the database connectivity toolset.  How do I code this using these VIs?  I dont see an example of a straight SQL string like this being able to be put into the VIs.

0 Kudos
Message 3 of 5
(1,125 Views)
Highlighted
It's been a long time since I used the toolkit and I don't have it installed but I know one of the functions is for a direct SQL query. The top level functions hide that but you just have to dig a little deeper on the palette. The context help window is your friend here.
0 Kudos
Message 4 of 5
(1,121 Views)
Highlighted

Thanks, I got the SQL query to execute but how do I see all the results in a table?  All I can get is a recordset ref returned where I have to navigate one record at a time....

0 Kudos
Message 5 of 5
(1,108 Views)