General discussion

Locked

VB6 to Access 2000 Database Link

By donq ·
I have a working Access 2000 application I want to convert into an executable using VB6.0. My Operating System is Windows 2000 and my VB comes from Visual Studio 6 w/SP-3 installed. I want Version 1.1 of my project named ?BNM? to link to an Accessback-end employing Microsoft?s DAO 3.51 Object Library. I don?t want to build this executable with the Access Developers Toolkit ? I need to learn pure VB and want to it managing objects I understand.

I am having trouble declaring and loading the link to BNM.mdb (my Microsoft Access 2000 application containing the tables, queries, forms, reports, and modules) into my VB Project named BNM. I have created a ?BNM? directory on my C drive where I store BNM.mdb (C:\DataByte\BNM\BNM.mdb) and the Visual Basic Project (C:\DataByte\BNM\BNM.vbp).

I installed the Microsoft DAO 3.51 Object Library (via Project | References) and renamed Form1 to ?frmDesktop?. My new VB Project hierarchy reads ?BNM(BNM.vbp)? and it has a Forms collection containing ?frmDesktop(Desktop.frm)?.

Where do I declare and place the code:

Dim db As Database

Set db = OpenDatabase(?C:\DataByte\BNM\BNM.mdb?)

I need one or more of my 12-15 tables available to every object I create within the BNM Visual Basic 6 project so I can write unique recordsets to each form?s load event?

When I place this code in my only Form?s Load Event I get a Run-ime Error ?3343.?: Unrecognized database format ?C:\DataByte\BNM\BNM.mdb?.?

What ?library? must I loadin order to connect to an Access 2000 .mdb file, and where and how should I call my link from within the (Visual Basic) BNM project? Can I also import and convert existing Access Forms so I don?t have to start from scratch defining my interface once I have a working connection?

Thanks in advance. Don Quigg

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB6 to Access 2000 Database Link

by andrew In reply to VB6 to Access 2000 Databa ...

I believe you need to use the DAO 3.6 Object Library to connect to an Access 2000 db.

The code port from the Access forms to the VB forms should be straightforward.

Collapse -

VB6 to Access 2000 Database Link

by donq In reply to VB6 to Access 2000 Databa ...

My error went away however I still don't have access to any of my Access database objects - which of course is what I need.

Collapse -

VB6 to Access 2000 Database Link

by donq In reply to VB6 to Access 2000 Databa ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums