Database object missing on new databases???

  • Thread starter Thread starter SUB
  • Start date Start date
S

SUB

Hi all,

Anybody understand why this is happening...

I have a copy of northwind db and it is Access 2000
format, when I enter the VBA code below it finds the
database object no probs.

Dim db as Database

Simple huh??

However, If I create a new database and try this it does
not find a reference to the database object??????

I have noticed as well, in the object viewer in VBA I
cannot find a reference to DOA which the database object
resides under. I think this is the issue but dont know
how to sort??? can you simple import/download library's?

Thankx in advance for any replies and support.

SUB
 
SUB said:
Hi all,

Anybody understand why this is happening...

I have a copy of northwind db and it is Access 2000
format, when I enter the VBA code below it finds the
database object no probs.

Access 97 had a reference set to DAO by default.

Access 2000 and 2002 do not. They default to ADO.

Access 2003 has both ADO and DAO references by default.

You'll need to add the reference yourself to use database objects in Access
2000. If you keep the reference to ADO then you will need to include the
library qualifier for those objects that exist in both libraries. For
example RecordSet is an object found in both libraries. If you have both
libraries referenced, then it will create the type from the library listed
first in your reference list. To avoid that you either need to NOT use both
references or qualify the object like this...

Dim rs as DAO.Recordset
Dim rs as ADO.Recordset
 
Back
Top