Link to home
Start Free TrialLog in
Avatar of dabrat
dabrat

asked on

Missing Reference in VB 6.0

I am working on a program that connects to a database.  I have the following statement:

If Cnn.State = adStateOpen Then Cnn.Close

But when I run the program I get an error (adStateOpen can't find project or library), am I missing a Reference and if so how do I add the reference.  The reason I ask is that when I go to Project -> References it says MISSING: Microsoft ActiveX Data Objects 2.7 Library.  Now I have followed the path that it gave for the correct DLL and it is there.  Can someone please help.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dabrat
dabrat

ASKER

I am not sure.  I am trying to work on this program on my laptop and my pc.  Now I did check and the pc has a newer version of the DLL and it works just fine.  
Avatar of dabrat

ASKER

okay, what I have done was to copy the newer version of the dll from my pc to my laptop.  Now the dll works just fine.  When I run the program I get this error:

Run-time error '429':

ActiveX component can't create object

it is this line of code that causes the problem:

If Cnn.State = adStateOpen Then Cnn.Close

any ideas?
You cannot just copy the DLL. You have to install MDAC. You can get it from http://msdn.microsoft.com/data/downloads/updates/default.aspx#MDACDownloads