dbTalk Databases Forums  

Opening Access 2K file in VB6

comp.database.ms-access comp.database.ms-access


Discuss Opening Access 2K file in VB6 in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dan Shelby
 
Posts: n/a

Default Opening Access 2K file in VB6 - 10-24-2003 , 10:42 AM






I would like to open an Access2000 database file in Visual Basic 6. When I
try it tells me that the database is in the wrong format. If I convert the
database to Access97 format, then the file opens with no problem. I have
tried the ADO route, and the DAO route, all to no avail. Obviously there is
a way to do this but I haven't been able to figure it out. Appreciate any
help you can give. Thanks.



Reply With Quote
  #2  
Old   
John
 
Posts: n/a

Default Re: Opening Access 2K file in VB6 - 11-07-2003 , 07:32 AM






access 97 databases are based on the older microsoft jet 3.5 engine.
access 2000 uses the newer 3.6 version of the jet database. Jet 3.5
uses DAO 3.51 and Jet 3.6 uses DAO 3.6.

What you need to do is create a reference to the MS DAO 3.6 and then
explicitly open your recordset:

Dim db As Database, rs As Recordset
Set db = DBEngine.OpenDatabase("c:\yourpath\yourdata.mdb")
Set rs = db.OpenRecordset("YourTable")
Set Data1.Recordset = rs

If you are using the ADO control that comes installed with vb6 then
upgrade to microsoft jet oledb 4.0 and it should just start working.

regards,

John
jobrien at acscience dot com
disclaimer: this answer was regurgitated from various sources and is
in no way a product of my own imagination.


"Dan Shelby" <daniel.shelby (AT) cox (DOT) net> wrote

Quote:
I would like to open an Access2000 database file in Visual Basic 6. When I
try it tells me that the database is in the wrong format. If I convert the
database to Access97 format, then the file opens with no problem. I have
tried the ADO route, and the DAO route, all to no avail. Obviously there is
a way to do this but I haven't been able to figure it out. Appreciate any
help you can give. Thanks.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.