From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX DAO or DB Connectivity to read from Access DB?

I am reading from a MS Access database using both the ActiveX DAO method and the DB Connectivity Toolkit methods.

In comparing the speed of retrieving records, the DAO
method is much faster (about 20-100 times) than the DB Connectivity method. Can this be right? Am I doing something wrong?

I've included both VIs.

Any help is greatly appreciated.
Download All
0 Kudos
Message 1 of 7
(3,002 Views)
Actually, I get the opposite results when I run your two VIs on some of my Access database tables. The Database Connectivity VI averaged about 40-50% faster than the DAO VI. In fact, the DAO method is not only slower, but it includes some annoying features that the Database Connectivity Toolkit method doesn't. The DAO method opens Access and the selected database in the background. When I have security enabled, the DAO method requires me to log in correctly before I can retrieve the data. Using the Database Connectivity Toolset, I can retrieve all the data without entering passwords and without Access even being on the machine.

I tried getting more detailed information about the DAO interface as compared with the ADO method used in the Database Connectivity
Toolset. However, I got bogged down in acronyms and references that all sounded the same on the Microsoft web site.

I'm curious to see what others report on this.
Message 2 of 7
(3,002 Views)
Thanks for the quick answer.

I'm wondering what operating system and version of Access you have on your machine. I'm running XP and Office XP (Access 2002).

I'm curious to see what other experience as well.
0 Kudos
Message 3 of 7
(3,002 Views)
I'm using Access 2000 on Windows 2000.
0 Kudos
Message 4 of 7
(3,002 Views)
I tried the VIs on several systems. Windows 2000 with Access 2000, WinXP with Access 2000, Win 98 with Access 2000, all with the same result.

As an example I'm extracting 50,000 rows of three columns from a database. The ActiveX method returns the data in 879 ms. (on the Win2000,AC2000) The DB Connectivity method takes 15 minutes then crashes!

I'm using LabView 6.02 on all of these machines. Using the DSN method I connect to a file DSN created through the ODBC Administrator.

Can anyone think of what I could possibly be doing wrong?
0 Kudos
Message 5 of 7
(3,002 Views)
When you have crashes occurring, I'm gonna back up and ask some basic questions like what version of LabVIEW are you using? Does a specific error message get displayed or does LabVIEW hang?

I'd also like for you to try a different program for the Database Connectivity Toolset. Open the Read All Data VI from the \\examples\database\database.llb. Try reading the large table again and let me know what happens.
0 Kudos
Message 6 of 7
(3,002 Views)
I was using LabView 6.01 and 6.02. I cleared LabView off of this computer and installed 6.1 today, but am experiencing the same results. I tried reading various sample databases inlcuded with the QUE book on Access 2002 with the same results as well.

I tried the Read All Data method with better results. Thanks! However the DAO ActiveX method is still the fastest on my systems.

The orginal DSN method hangs if I am reading large tables, and ends up in the program not responding, no particular error message.

I'm looking into this further.
0 Kudos
Message 7 of 7
(3,002 Views)