Dim cnn As Connection

ice-9

Registered User.
Local time
Today, 07:27
Joined
May 21, 2004
Messages
88
Hi,

I have a question.
When i search for examples, i often find what i need. When it concerns databases, i get i bit of trouble. I looked some stuff up in books, but still im a bit confused. Here is the thing.
When i want to edit a database. I use the following code:

Dim cnn As Connection
Set cnn = CurrentProject.Connection
cnn.execute .... and so on.

But i always get the type mismatched error, but when i but ADODB infront of the declaration, i does work. All the examples i read the dont use adobd in front of it. What does it do? What is the difference?


Thanks for your reply
 
By putting ADODB in the Dim statement you are "disambiguating" the library (specifying the library). You probably have both ActiveX and ADO checked in your references and the two libraries have some definitions with the same names. There is no problem using both libraries as long as you specify which library you are using each time.
 

Users who are viewing this thread

Back
Top Bottom