Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Missing Reference in VB 6.0

Posted on 2004-08-06
4
Medium Priority
?
579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 150 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 70

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

609 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