What do the Refrence file need? (1 Viewer)

wlgzhang

Registered User.
Local time
Today, 00:35
Joined
Aug 16, 2004
Messages
19
Hi everyone,

A simple question here:

I try to copy my 97 access database application to 2000 version I recently installed, but I could not run my db since it dose not recognize the DAO objects, such as object currentdb ..., in my code.
I would like use DAO objects in the access 2000, what system files should I register and what the reference files should I link to before run the vb code?
I have linked to DAO 3.6 object library, MS Access 10.0 object library, Office 10.0 object library, OLE Automation, Active Data object 2.6 Library, Excel 10.0 and Word 10.0 libraries.

Appreciate any help.

Wei
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:35
Joined
Feb 19, 2002
Messages
43,331
There are two ways to resolve this problem
1. The simple way is to open the reference list and move the DAO 3.6 library up in the list until it is higher than the ADO library. This list of reference libraries is what Access uses to interpret code that it encounters. DAO and ADO share some objects and since you know all your code is DAO, you don't want Access to interpret any of it as ADO becase it checked the ADO library first.
2. The best way is to qualify all DAO objects by prefixing them with DAO..
Dim db As DAO.Database
Dim rs AS DAO.Recordset
Dim qd AS DAO.QueryDef
etc.
This method allows DAO and ADO to coexist and won't be affected if the library order is changed.
 

wlgzhang

Registered User.
Local time
Today, 00:35
Joined
Aug 16, 2004
Messages
19
Pat,
Thank you for your help!

Wei
 

Users who are viewing this thread

Top Bottom