SQL User Type Error

G

Guest

I have been trying to learn programming and I have some sample programs to
study and work with. When I key them in, they work up to a point, then I get
an error statement about the "User-type not defined". This is on the statement
Dim T As TableDef

I have looked into the Tools/references and I have the following checked
Visual Basic for Applications
Microsoft Access 9.0 Object Lib
OLE Automation
Microsoft Active X data Objects 2.1 Lib

The Help for this error says to check the "Data Access Object", and I don't
have it listed in the References as a choice unless it has a different name.
Can anyone tell me what to check or uncheck?
 
J

John W. Vinson

I have been trying to learn programming and I have some sample programs to
study and work with. When I key them in, they work up to a point, then I get
an error statement about the "User-type not defined". This is on the statement
Dim T As TableDef

I have looked into the Tools/references and I have the following checked
Visual Basic for Applications
Microsoft Access 9.0 Object Lib
OLE Automation
Microsoft Active X data Objects 2.1 Lib

The Help for this error says to check the "Data Access Object", and I don't
have it listed in the References as a choice unless it has a different name.
Can anyone tell me what to check or uncheck?


Scroll down to "Microsoft DAO x.xx Object Library" and check it.

You may want to uncheck the Microsoft ActiveX Data Objects reference:
ADOX and DAO have some objects with the same names (Recordsets and
Fields for example). If you leave both checked it's prudent to
explicitly specify the library in the Dim:

Dim db As DAO.Database
Dim rs As DAO.Recordset

etc.

John W. Vinson [MVP]
 
G

Guest

John W. Vinson said:
Scroll down to "Microsoft DAO x.xx Object Library" and check it.

You may want to uncheck the Microsoft ActiveX Data Objects reference:
ADOX and DAO have some objects with the same names (Recordsets and
Fields for example). If you leave both checked it's prudent to
explicitly specify the library in the Dim:

Dim db As DAO.Database
Dim rs As DAO.Recordset

etc.

John W. Vinson [MVP]
Thanks John,
I have been reading about the difference between the DAO and ADO through
some of the other posts, but as a beginner it was confusing. I followed your
advice and now I don't get that error statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top