HELP!! Dim db As Database => compile error: user defined type not defined 
Author Message
 HELP!! Dim db As Database => compile error: user defined type not defined

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



Mon, 06 Jan 2003 03:00:00 GMT  
 HELP!! Dim db As Database => compile error: user defined type not defined
In a module, try going to references, adding DAO 3.6 and removing the
reference to ADO....

HTH,

- Aaron

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




Mon, 06 Jan 2003 03:00:00 GMT  
 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




Mon, 06 Jan 2003 03:00:00 GMT  
 HELP!! Dim db As Database => compile error: user defined type not defined
Mihalis,
        A2000 does not reference DAO as default, A97 does.You need to set a
reference to DAO and place it above ADO for A2000 to recognise it.
HTH
Ian Pratt
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




Tue, 07 Jan 2003 03:00:00 GMT  
 HELP!! Dim db As Database => compile error: user defined type not defined
It is better practice to explicitly declare variables, rather than relying
on the order of the references to ensure that objects that belong to more
than one object library are declared properly. It also makes it more obvious
when you come to review your code in 6 months time. Use:

Dim rsADO As ADODB.Recordset
Dim rsDAO As DAO.Recordset

--
Jon


Quote:
> Mihalis,
> A2000 does not reference DAO as default, A97 does.You need to set a
> reference to DAO and place it above ADO for A2000 to recognise it.
> HTH
> Ian Pratt


> > 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




Tue, 07 Jan 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Compile Error: User-defined type not defined

2. Compile Error - User defined type not defined

3. Compile Error - User-Defined type not defined

4. Compile error: User-defined data type not defined!

5. Compile error: User-defined type not defined

6. db As Database = User-defined type not defined

7. Dim oappWD as Word.Application: User defined type not defined

8. Dim oappWD as Word.Application: User defined type not defined

9. user defined type not defined error help please

10. Help!!-NEWBIE - Application Wizard -(WROX BOOK) Error- User defined type not defined

11. Help!!-NEWBIE - Application Wizard -(WROX BOOK) Error- User defined type not defined

12. Microsoft Visual Basic Compile Error: Uder-defined type not defined

 

 
Powered by phpBB® Forum Software