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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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
ASKER