vlad.lisnyi
vlad.lisnyi

Reputation: 345

ADODB.Connection ISSUE

Please advice on the following problem. I am using the script in VBA:

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sConnString As String

I found this script in another Excel Workbook and was trying to adopt it to my own macro in order to retrieve data from server. But due to some reasons my macro fails each time with the following ERROR:

Compiler error:
User-defined type not defined

I think the problem is in ADD-INs, but seems everything is utilized.

Upvotes: 1

Views: 613

Answers (1)

A.S.H
A.S.H

Reputation: 29352

In the VB Editor:

Tools --> References --> check Microsoft Activex Data Objects x.y Library

In case you have many such options, choose the latest version (highest x.y).

Upvotes: 2

Related Questions