?
Solved

Missing Reference in VB 6.0

Posted on 2004-08-06
4
Medium Priority
?
573 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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