LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute MS Access query

I'm trying to execute an existing query that I've saved in MS Access, but I can't seem to find the right combination of Invoke/Property nodes to return the recordset that results from the query.
I thought this would be straight-forward, but NoJoy.  Help?
 

0 Kudos
Message 1 of 9
(3,062 Views)

To begin with, Access is not a database, it's an applications development environment that sits on top of a DBMS called Jet that is built into Windows. Hence, if you want to execute a query all you need to do is use ADO to talk directly to Jet. For examples look here.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(3,060 Views)

To begin with, I never implied Access was a database, I stated that it was the program that I'd used to define a Query. Smiley Tongue
I've discovered that Access will show the Query syntax in Design View, so I'm going to try sending the copied SQL text via ADO.

 

Wish me luck, I'll update with what I find. 


0 Kudos
Message 3 of 9
(3,042 Views)

Looks like this is the Big Winner.

Last glitch, how do I close Access programmatically?  When I run this VI, it leaves Access open, and I'd like it to Exit when it finishes. 

0 Kudos
Message 4 of 9
(3,037 Views)

Spoke too soon, it's returning a default recordset that opens, not the query....

Strugglin' On.

0 Kudos
Message 5 of 9
(3,029 Views)

Why are you using Access functions? You said you were going to use ADO. Since it sounds like you don't have NI's toolkit, and did not use Mike's ADO functions, try the free LabSQL.

0 Kudos
Message 6 of 9
(3,023 Views)

The SQL function works just as well as the VI snippet I posted above; which is to say, not at all.

0 Kudos
Message 7 of 9
(3,016 Views)
What SQL function? Post that code.
0 Kudos
Message 8 of 9
(3,011 Views)

So what is the SQL you are trying to run. When you say it doesn't work, do you mean that it returns an error or you just don't get any data back? Can you post the *.mdb file you are trying to query as well - or at least what the table schemas are?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 9
(3,000 Views)