Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection problem

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
Ok, so I wrote a little VB program to do some database work for me on a test database, then I tried to just copy it over to my real database, and I'm finding problems... I'm thinking most of them have something to do with ADO vs. DAO, but I dunno. I made a second test database, cut'n pasted, and everything was fine... so I'm figuring it has to be some setting in the original DB.

I've pared it down to

Dim cnn As Connection

Set cnn = CurrentProject.Connection

and I get a type mismatch error, I have a feeling that if I can get that fixed, the other issues while resolve themselves, but we'll see.

Thanks much for any help,

Rob
 
Don't you love solving your own problems... well in case anyone else is having this issue, the answer for me was,

in the VB editor, under tools, references

To turn off
Microsoft DAO 3.6 Object Library
and
Microsoft VB for App. Extensibility 5.3

and to turn on

Microsoft ActiveX DataObjects 2.1 Library

-Rob
 
The other option is to explicitly define the ADO and DAO objects where they can be in conflict. I leave both the DAO and ADO references set in my programs - both libraries can be used side by side. Most of the conflicts are where the objects have the same names in both libraries. Like Recordset, Field, etc..

Dim cnn As ADODB.Connection
Dim db As DAO.Database
Dim rs as DAO.Recordset
Dim rs as ADODB.Recordset
etc.. as you need to use these objects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top