VB4: Dim db as Database error in Class module 
Author Message
 VB4: Dim db as Database error in Class module

When run a simple OLE Server app in VB4 EE, I get an error wherever
I declare a Database variable.

Eg.

Dim db as Database

Error: User Defined Type not allowed

This also happens for Recordset declarations.
I've tried declaring them Global in a separate code module, ie
outside the Class modules, but that didn't help.

When I create an ordinary project, ie not an OLE server,
I don't have the problem. Any ideas?

Thanks,

Paul Jeffrey



Wed, 11 Nov 1998 03:00:00 GMT  
 VB4: Dim db as Database error in Class module

Quote:

> When run a simple OLE Server app in VB4 EE, I get an error wherever
> I declare a Database variable.

> Eg.

> Dim db as Database

> Error: User Defined Type not allowed

> This also happens for Recordset declarations.
> I've tried declaring them Global in a separate code module, ie
> outside the Class modules, but that didn't help.

> When I create an ordinary project, ie not an OLE server,
> I don't have the problem. Any ideas?

I haven't actually experienced this problem myself, but have you
double checked that the appropriate DAO is checked in the
References list???

--
Karl Costenbader, President
Competent Consulting
Sacramento, CA

Home Page: http://www.competent.com



Thu, 12 Nov 1998 03:00:00 GMT  
 VB4: Dim db as Database error in Class module

Quote:

>When run a simple OLE Server app in VB4 EE, I get an error wherever
>I declare a Database variable.
>Eg.
>Dim db as Database
>Error: User Defined Type not allowed

Easy.

YOu have a class module called "Database".
Maybe you loaded a VB3 project into VB4, one file being called DATABASE.BAS ?

Same thing happened to me, and it was confusing!

Robert.



Fri, 13 Nov 1998 03:00:00 GMT  
 VB4: Dim db as Database error in Class module

Quote:

> When run a simple OLE Server app in VB4 EE, I get an error wherever
> I declare a Database variable.

> Eg.

> Dim db as Database

> Error: User Defined Type not allowed

> This also happens for Recordset declarations.
> I've tried declaring them Global in a separate code module, ie
> outside the Class modules, but that didn't help.

> When I create an ordinary project, ie not an OLE server,
> I don't have the problem. Any ideas?

> Thanks,

> Paul Jeffrey

Are any of the DAO libraries selected in the references dialog?


Fri, 13 Nov 1998 03:00:00 GMT  
 VB4: Dim db as Database error in Class module

begin 644 clsdb.cls
<uuencoded_portion_removed>

`
end



Sun, 15 Nov 1998 03:00:00 GMT  
 VB4: Dim db as Database error in Class module

I too had this problem originally.

The attached class module does a lot of the DAO busywork and may be
helpful to those working in that mode.  Note:  I have not explored all
the various connect options so you may need to add the specific one
for your target DB.



Sun, 15 Nov 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Dim obj As New Class crt Dim Obj As Class = New Class

2. References Error (Dim db As Database) - A2000

3. dim db as database gives an error

4. 'Dim db As DataBase' error

5. Class modules 97 - Refering to array within a custom class module

6. Accessing procedures of a class module from another class module

7. dim db as database fail in Access XP

8. Dim db as Database in ADO - Access 2k

9. Dim db as database

10. Dim db As Database

11. Why No Dim db as Database?

12. DIM db as database

 

 
Powered by phpBB® Forum Software