Solved

Missing Reference in VB 6.0

Posted on 2004-08-06
4
549 Views
Last Modified: 2013-12-25
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
Comment
Question by:dabrat
  • 2
  • 2
4 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 11738045
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
 
LVL 1

Author Comment

by:dabrat
ID: 11738077
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
 
LVL 1

Author Comment

by:dabrat
ID: 11738112
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
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 11738150
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now