ADODB.Connection Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get this error, "Compile Error: User-defined type not defined"
when I try to execute this line of code:

Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long

I copied this code line from a previous thread that was talking about
loading data from excel to access. Any ideas what this error is and how to
solve it?
(The first part of the line seems to be where the error comes from. )
 
You need to add a reference to Microsoft ActiveX Data Objects Library 2.?

In the VBE Select Tools -> References -> Microsoft ActiveX Data Objects
Library 2.?
 

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

Back
Top