[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 582
  • Last Modified:

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.
0
dabrat
Asked:
dabrat
  • 2
  • 2
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
have you installed ADO 2.7 or do you have an older version of ADO?

>>Now I have followed the path that it gave for the correct DLL and it is there

Almost all (in not all) versions of ADO are using the same DLLs that is overwritten at each update. You can check the DLL's properties to see which version it is.
0
 
dabratAuthor Commented:
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.  
0
 
dabratAuthor Commented:
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?
0
 
Éric MoreauSenior .Net ConsultantCommented:
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
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now