DAO.Database vs Database

  • Thread starter Thread starter Jean
  • Start date Start date
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
 
The 2 code fragments you posted are exactly the same except for indentation
which doesn't make any difference.

Typos, perhaps???
 
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
 
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.
 
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.
 
Back
Top