View Full Version : database object in code


simonli
10-03-1999, 09:48 PM
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.

Simon C
10-05-1999, 12:40 AM
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.

simonli
10-09-1999, 09:54 AM
I find out that the other way is to set the Reference to DAO 3.6 under Tools.