LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read a record out of a microsoft access database using ActiveX ?

I am using the following methods/properties in my vi but I can't find the
right one to read a value of a table (query table or just data table):
application.currentdb then database.openrecordset(name of the table) , from
this point I can't find the right method to display the value of a cell in
the table.
Any help would be greatly appreciated
Thanks
C.D.
0 Kudos
Message 1 of 7
(4,034 Views)
On Mon, 30 Sep 2002 15:15:15 -0700, "Chris D."
wrote:

>I am using the following methods/properties in my vi but I can't find the
>right one to read a value of a table (query table or just data table):
>application.currentdb then database.openrecordset(name of the table) , from
>this point I can't find the right method to display the value of a cell in
>the table.
>Any help would be greatly appreciated
>Thanks
>C.D.
>
>

If you're using Access2000, I have the VIs at work.
Email me and I can email them to you Wednesday - I'm not in the
officie tomorrow.

L
0 Kudos
Message 2 of 7
(4,034 Views)
CD,

Another possible route for you to go is to use the SQL toolkit. There is a cost involved, but I believe it is well worth the price for most applications. It is a direct link to the database, and requires no external code (ActiveX).

Just a thought...
Message 3 of 7
(4,032 Views)
I've the same problem,
can you mail me your VI too?
0 Kudos
Message 4 of 7
(3,847 Views)
Who are you addressing your question to? This post is 3 1/2 years old. I wouldn't recomend ActiveX for connecting to Access (I wouldn't recomend Access either, but that's another question). ActiveX is slow and you're required to have a local installation of Access. Instead, NI sells the Database Connectivity Toolkit and there is also http://www.jeffreytravis.com/lost/labsql.html
0 Kudos
Message 5 of 7
(3,841 Views)
thanks for the link, I'll try the SQL data exchange
0 Kudos
Message 6 of 7
(3,831 Views)
you must set a pointer to that openrecordset command.  I've never done this in LabVIEW, but I've found once you get an algorithm down recreating it in LabVIEW just means you have to think about it a little.

rec = database.openrecordset("SELECT * FROM table;");
Do While NOT rec.eof
    debug.print rec("fieldname1")
    debug.print rec("fieldname2")
    debug.print rec("fieldnameetc")
    rec.movenext
Loop
rec.close
database.close

So the openrecordset function passes a pointer to a recordset object that has methods for moving around and outputting the data.

-nic

0 Kudos
Message 7 of 7
(3,827 Views)