?
Solved

MS Access connection from VB 6

Posted on 2010-01-05
5
Medium Priority
?
187 Views
Last Modified: 2012-05-08
Hi - I am a .NET developer working on a legacy app and I need to access MS Access from VB 6. I have found some samples on how to do this (E.g http://bytes.com/topic/visual-basic/answers/569821-how-do-i-connect-vb-6-0-form-access-database) however the code fails on the first line:

Dim con As New ADODB.Connection

Compile Error: User -defined type not define

Do I need some kind of import?
0
Comment
Question by:jes12345
  • 2
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
CSecurity earned 668 total points
ID: 26180102
Yes

Click Project Menu, Then References.

Then add AcriveX Data Objects 2.8 or 2.7 or any version you have installed.
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 1332 total points
ID: 26180109
If you haven't added a reference already try Project > Project References > Microsoft ActiveX Data Objects Library
0
 

Author Comment

by:jes12345
ID: 26180782
Thanks for the advise. Worked like a charm. Is the
"Microsoft ActiveX Data Objects Library" standard Windows library? I.e can I know for sure this will be installed on a XP,Vista or Win 7 target machine?
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 1332 total points
ID: 26180819
You will need to install/register with the application.
0
 

Author Closing Comment

by:jes12345
ID: 31672887
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

621 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