Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO database

Status
Not open for further replies.

davikokar

Technical User
Joined
May 13, 2004
Messages
523
Location
IT
Hallo,
some time ago I wrote some code in order to esport some data from a access table to an excel sheet. I used the DAO. I don't exactly know the differences of these ways to access data. Anyway, now I was trying to use this code and I discovered that I first needed to add the microdoft DAO 3.6 library. This would mean that a normal user wouldn't be able to use it. First, I wonder why. Is DAO an old system? should I rewrite the code using ADO? Or can I programatically include the DAO library before running the code? Thanks for clarifications
 
Access 2000 started using ADO as it's default. However, it still supports DAO. Yes, you will need to include the Microsoft DAO 3.6 library in your references. Your users will be fine.

I wouldn't bother rewriting the database to use ADO. Either prefix all of your database and recordset declarations with DAO (i.e. Dim rst as DAO.Recordset). If you don't want to do this, then make sure your reference to Microsoft DAO 3.6 library is referenced above the ADO reference (I believe it's the Microsoft Access 9.0 Object Library).

In future databases, I would begin using ADO rather than DAO.
 
thanks fancy,
how can I programatically (in the vba code) load a library?
 
Open a module and goto Tools|References... via the menu bar. Select your library from the list.
 
Just to clarify, you don't need to "programmatically load a library" at run time. When you put it in your References, the reference becomes a permanent part of your database and Access will attempt to load it when the user opens the database.

The only problem would be if Access on the user's machine can't find the DAO library. That probably won't happen, but if it does, come back for more help.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
aahh, now things are clearer, thanks to both
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top