
HELP!! Dim db As Database => compile error: user defined type not defined
This is one of the differences of A2K to previous versions. It uses ADO by
default, whereas previous versions used DAO, which included the Database
object.
You need to set a reference to DAO 3.6 in each database that you use if you
want to use DAO, as references to Object Libraries are database specific.
From the main database window, press Ctl-G to bring up the debug window.
Then select Tools|References. Add DAO, and you may also want to remove the
reference to ADO. If you don't, you will need to be careful with
declarations for objects that appear in both object libraries, eg
recordsets:
Dim rsADO As ADODB.Recordset
Din rsDAO As DAO.Recordset
--
Jon
Quote:
> Access 97 project, converted to Access 2000
> gives me compile error: user defined type not defined
> in the: Dim db As Database -- declaration.
> It must have something to do whith the VBA version,
> probably the new version do not recognize Database as data type.
> If you have any sugestions around this situation I would be very thankfull
> Thanks in advance.
> Tsuhlarakis Mihalis