database object in code

  • Thread starter Thread starter simonli
  • Start date Start date
S

simonli

Guest
Hi there,

When I create a blank new database in Access 2000, I notice that the VBA statement:

dim dbs as database

does work anymore. However, if I convert an Access97 database into 2000, that same statement works perfectly.

I would like to know why and how I can make it work from a database that I created in Access2000 directly.
 
You need to declare the database as a DAO object:

Dim dbs As DAO.Database

Or you can use what you were using and explicity declare, for example, recordset objects as

Dim rst As DAO.Recordset

Hope that helps.
 
I find out that the other way is to set the Reference to DAO 3.6 under Tools.
 

Users who are viewing this thread

Back
Top Bottom