Solved

Connecting Access 2000 DB

Posted on 2002-04-03
3
169 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 51

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 51

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 70

Expert Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

856 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