To use the ADO data types and procedures you first need to establish a
reference to the MS-ADO Library. This library contains all the "code" that
handles ADO connections for you.
In the VBA editor (alt-F11) go to Tools References tick the box next to
Microsoft Active Data Objects 2.x library.
If you've never used ADO connections in VBA or
VB before I suggest that you
search the internet for a tutorial. I'm sure there's heaps out there.
- Rm
"Terry" wrote:
Hello!
I want to use Excel document connect Access database via ADO Connection.
I claim the following sentence in my program:
Dim conn As ADODB.Connection
It prompt the following error message while I compile my program:
User's type undefine
I lookup Excel's help for ADO Connection. It just pivottable connect Access
database via ADO Connection has been told. This help is no use for me.
Please tell how to use ADO Connection in Excel VBA. Thanks!