View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default ADODB.Connection Error

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.?
--
HTH...

Jim Thomlinson


"Mike H." wrote:

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