Compile Error - ADODB.Recordset Error "User-defined type not defined"

C

CES

All,
I'm at a total loss, I've used this connection syntax forever and have never had a problem but I'm now not able to get this to work in Access 2007(Vista).

The error Compile Error ("User-defined type not defined") points to "Dim rst As ADODB.Recordset" below you will find offending code:

Public Function ValidateUser()

Dim rst As ADODB.Recordset
Dim strSQL As String

End Function

I saw a post that indicated I might have to set a reference using Tools\References\Available References, however I'm not exactly sure which one I should check as there are 9 variations of "Microsoft ActiveX Data Objects" FYI - the only objects that are checked under available references are:

Visual Basic for applications
Microsoft access 12.0 object Library
OLE automation
Microsoft office 12.0 access database engine objects library

Any help on this would be appreciated. Thanks in advance. - CES
 
D

Douglas J. Steele

In previous versions of Access, using ADODB required a reference to the
Microsoft ActiveX Data Object 2.x Library. I would assume it's no different
in Access 2007.

Microsoft office 12.0 access database engine objects library is the
equivalent of DAO, not ADO.
 

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