LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get data from Access with ActiveX

Solved!
Go to solution
Dear readers,


I was trying to alter the example Access_ActiveX.vi from NI for reading only one column instead of a whole table. (http://digital.ni.com/public.nsf/3efedde43...cess_ActiveX.vi)
I could not figuere out how. I have a rather big database so it would be wrong to read all information and then filter it. (waste of time)

Thanks in advance

Best regards


Steven
0 Kudos
Message 1 of 8
(3,865 Views)
What you will need to do is to run a query that only returns the field of interest in your table.  This could be a query that is already predefined in the database, or one you programmatically define in LabVIEW then run.
0 Kudos
Message 2 of 8
(3,847 Views)

Save yourself a bunch a grief and skip the Access ActiveX interface. Use NI's database toolkit, LabSQL or search the board for other ADO examples. You won't have to open the Access application and you can use any database you want.

 

 

Message 3 of 8
(3,828 Views)

Thanks for the replies.

 

I tried the labSQL and Database toolkit. This works fine with the example and other simple databases but not with mine.

The one i got makes use of crossreferences. I think this causes conflicts. (unnamed 1st table - see attachement). Creating a new database is not an option.

That is why i want to use ActiveX but i just cant find the right properties and methods to get the result. It is the first time i try to read from a db.

 

So, more tips and hints are welcome.

 

Steven

 

 

0 Kudos
Message 4 of 8
(3,818 Views)
Solution
Accepted by topic author Steviooo
If you are having problems with a query in LabSQL, then that is a problem with the way yuo've done the query. I'm not sure what you mean by cross-references. Are you talking about linked tables? Do you know that you can display the SQL syntax in Access when you use the query wizard? I've used LabSQL on very complex databases and can tell you from experience that it works on more than just simple tables. Look for a SQL tutorial and study inner and outer joins.
Message 5 of 8
(3,803 Views)

Thank Dennis!

 

This sounds like a good solution! I will try it now.

 

Steven

0 Kudos
Message 6 of 8
(3,798 Views)

You were right, Dennis! Thanks! There was just something wrong with my SQL syntax. It was a good idea to use the wizard. Thanks again.

 

Best regards

 

Steven

0 Kudos
Message 7 of 8
(3,794 Views)

One more thing.  Is it possible to query a query with labSQL?

 

 Best regards

 

Steven 

 

 

0 Kudos
Message 8 of 8
(3,734 Views)