MS Access connection from VB 6

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?
jes12345Asked:
Who is Participating?
 
CSecurityCommented:
Yes

Click Project Menu, Then References.

Then add AcriveX Data Objects 2.8 or 2.7 or any version you have installed.
0
 
nffvrxqgrcfqvvcCommented:
If you haven't added a reference already try Project > Project References > Microsoft ActiveX Data Objects Library
0
 
jes12345Author Commented:
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
 
nffvrxqgrcfqvvcCommented:
You will need to install/register with the application.
0
 
jes12345Author Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.