LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access MSAccess.

Hello Everybody
The example access.llb said that it is impossible to communicate
with MSAccess via DDE. It this true? I can hardly believe this,
how come, that Bill produced this kind of ..... I am
disappointed.
So it looks as though there is only one possibility to
communicate with MSAccess - via text file by running the macro
written in Access? Not good enough.

Best regards
PP
0 Kudos
Message 1 of 10
(4,632 Views)
You can use ActiveX too, it's a bit tricky but can be done.
Hope this helps
0 Kudos
Message 2 of 10
(4,630 Views)
I think you CAN communicate with Access via DDE but DDE is a pretty poor
protocol. Also, generally you don't WANT to communicate with Access using
Labview.

Access is not a database; it is a user interface to the "Jet" database
engine within the system. Using ActiveX you can communicate directly with
this database engine and you get much higher efficiency than if you
communicate with Access and ask it to communicate with the database on your
behalf. In addition- though I'm not quite sure of this- I think the Jet
database engine is installed as standard, meaning you don't actually need
Access installed in able to manipulate Access databases through Labview.

There are two ways in which you can use ActiveX; the first is to use the
full functionality of the DAO/ADO ActiveX objects which will allow you to
perform operations directly on the database. I've not bothered with this
since it's a very proprietary method and I prefer the more standard approach
of using ActiveX only as much as is necessary to execute conventional SQL
commands on the database. SQL is a database access language that pretty much
works on any mainstream database on any platform.

I once received an example of how to do this (from a guy whose email address
is Frank_Speers@bigfoot.com) and adapted it for my purposes, and I've
attached my version of the example as two general routines, one to open the
database connection and one to send a command to it. Look in your local
library for a good SQL textbook; I can recommend "Mastering SQL" by Gruber,
published by Sybex.


Pawel Pocwiardowski wrote in message
news:3BB2CD65.517E6ACA@reson.dk...
> Hello Everybody
> The example access.llb said that it is impossible to communicate
> with MSAccess via DDE. It this true? I can hardly believe this,
> how come, that Bill produced this kind of ..... I am
> disappointed.
> So it looks as though there is only one possibility to
> communicate with MSAccess - via text file by running the macro
> written in Access? Not good enough.
>
> Best regards
> PP



[Attachment SQL Open Connection.vi, see below]


[Attachment SQL Send.vi, see below]
Download All
Message 3 of 10
(4,631 Views)
Besides ActiveX, there is also the Database Connectivity Toolkit that NI sells. There have been numerous threads here on database connections. If you do a search, I'm sure you'll find a lot better solution than DDE or text files.
Message 4 of 10
(4,630 Views)
Thank you a lot.
I think I will try the Active X one.
Best regards
PP
0 Kudos
Message 5 of 10
(4,630 Views)
If you can get the ActiveX solution working, please let us know how.

I have been able to use Perl to write to an MS Access 2000 table.


On Fri, 28 Sep 2001 06:12:02 +0100, Pawel Pocwiardowski
wrote:

>Thank you a lot.
>I think I will try the Active X one.
>Best regards
>PP
0 Kudos
Message 6 of 10
(4,630 Views)
Hi,
I 've tried the 2 vi SQL_Connect and SQL_Send. I connect them and run a simple SQL query. It works for a while but subsequently, the 'SQL_Connect.vi' returns an unspecified error (-214746725)..see attached. Can someone help? The other question I have is whether can I used SQL in labview to query a database with link tables? Thanks in advance.

Regards,

Chee Meng
0 Kudos
Message 7 of 10
(4,630 Views)
I also have a project on database query and this is great! It works! Keep up the good work!
0 Kudos
Message 8 of 10
(4,630 Views)


@CraigGraham wrote:
[Attachment SQL Open Connection.vi, see below]


[Attachment SQL Send.vi, see below]





I tried closing the connection by issuing the _Connection 'Close' invoke node after "SQL_open -> SQL_Send" with no luck. How do I successfully close connections?


- Martin
0 Kudos
Message 9 of 10
(4,580 Views)

Hi pawel,

There is also a set of MS Access examples that are shipping examples in LabVIEW that use DDE:

LabVIEW 7.1\examples\comm\access.llb\Retrieving Data from Access.vi
LabVIEW 7.1\examples\comm\access.llb\Sending Data to Access.vi

As the previous posts have mentioned, DDE is an older protocol that can be used to communicate between applications, however, ActiveX has currently the preferred method over DDE. 

NI does provide the Database Connectivity Toolset to make database connection easier in LabVIEW.

Hope this helps. Thanks again and have a great day!

Kileen

0 Kudos
Message 10 of 10
(4,558 Views)