DAO.Database vs Database

J

Jean

Hi,

Is there any difference between these two:


Dim db As DAO.Database
Set db = CurrentDb()


and

Dim db As DAO.Database
Set db = CurrentDb()

Thanks

Jean
 
V

Van T. Dinh

The 2 code fragments you posted are exactly the same except for indentation
which doesn't make any difference.

Typos, perhaps???
 
I

Immanuel Sibero

No Difference.

From the subject line, maybe you meant the difference between:

- Dim db As DAO.Database
- Dim db As Database

First line specifically uses DAO, the second line lets Access choose between
DAO and ADO whichever comes first.

Immanuel Sibero
 
D

Douglas J. Steele

The ADO model does not have a Database object in it. What you say is correct
for Recordset, though, since that object exists in both models.
 
D

Douglas J. Steele

When you put a library name in the declaration (such as Dim db As
DAO.Database), it's referred to as "disambiguation". That means that Access
knows exactly which library to look in for the definition. When you don't
disambiguate, Access will search through all the libraries until it finds an
object by that name. If there's a problem with any of the libraries, Access
will run into problems trying to search through the libraries, so
disambiguation is always a good thing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top