Solved

Connecting Access 2000 DB

Posted on 2002-04-03
3
153 Views
Last Modified: 2010-05-02
I'm running VB6 SP5 Full Install, and trying to open some DB tables (Access 2000) with methods such "OpenDatabase", but I get an error of "Unidentified Data Base Type" or something like that. What Patch/Pack/Driver/File/Library/JET Version or whatever must I install in order to make it work with A2000, and where can I find it. (I'm not using Data nor ADO objects which I know already came with such an option, I'm intended to use code only). I'll thank a lot the help that you may give me.
0
Comment
Question by:pire
  • 2
3 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6917057
Hi pire,

OpenDatabase is available for DAO:

Example:

Dim db As DAO.Database
        Dim dbEngine As New DAO.dbEngine
        Set db = dbEngine.OpenDatabase(DBPath)
.
.

Are you going to use ADO to connect to the Access Database?
0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 6917070
For ADO:

Example:

Dim myConn As New ADODB.Connection
Dim rs As New ADODB.Recordset

.
.
myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\abc.mdb;Persist Security Info=False"
    myConn.Open
   
    rs.Open "Select Max(id) As MaxID from [Table]", myConn, 1, 3
    MaxPLID = rs.Fields!MaxID
    rs.Close
.
.
   
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6917103
you need DAO 3.6 or ADO Jet 4.0
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now