ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ADODB.Connection Error (https://www.excelbanter.com/excel-programming/394993-adodb-connection-error.html)

Mike H.

ADODB.Connection Error
 
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. )

Jim Thomlinson

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



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com