help with jet 4.0

Posted on 2002-03-13
Last Modified: 2013-11-20
I can't get an access 2000 database to open on my machine using

db.Open(_T("Microsoft.Jet.OLEDB.4.0"), &dbinit);

Any idea?
I am using atl object wizard, and trying to make an oledb consumer using jet 4.
This works fine when I use jet 3.51


Question by:bebonham
  • 3
  • 3

Author Comment

ID: 6862665
can I see some sample code?
LVL 23

Expert Comment

by:Roshan Davis
ID: 6863542

If you try to gain access to an Access 2000 database, you might experience one of the following errors within your Visual Basic program:

If you are using ADO (or the ADO Data Control):

Run-time error -2147467259 Unrecognized Database Format XXX
If you are using DAO (or the DAO generic Data Control):
Run-time error 3343 Unrecognized Database Format XXX

Access 2000 uses the Jet 4.0 engine, which creates Jet 4.0 format database files. Jet 3.5 components do not recognize such a format.

If you are using ADO, you get error -2147467259 when you try to connect to your Access 2000 through the "Microsoft.Jet.OLEDB.3.51" provider.

If you are using DAO, you get error 3343 above when you use the "Microsoft DAO 3.51 Object Library."

The DAO generic Data-Control does not work against Access 2000 databases, and always generates error 3343 unless used as instructed in the "Resolution" section of this article. This occurs because this control is based on Jet 3.51 and only recognizes Jet 3.51 (or before) database formats.

To resolve this problem, do one of the following:

Install Visual Studio Service Pack 4.

For ADO (or the ADO Data Control), use the "Microsoft.Jet.OLEDB.4.0" provider.

For DAO, go to Project menu, and choose References to use the "Microsoft DAO 3.6 Object Library."

If you use the generic Data-Control, you need to open a DAO 3.6 recordset and then assign it to be the source of the Data Control as follows:

Option Explicit
Private daoDB36 As Database
Private rs As DAO.Recordset
Dim sPath As String

Private Sub Form_Load()
sPath = _
"C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
Set daoDB36 = DBEngine(0).OpenDatabase(sPath)
Set rs = daoDB36.OpenRecordset("Customers")
Set Data1.Recordset = rs
End Sub
This problem has been addressed by Visual Basic Service Pack 4. A new value (Access 2000) has been added for the Connect property that will allow the DAO Data Control to open Access 2000 databases.

Microsoft has resolved this issue in Visual Studio Service Pack 4. A new value (Access 2000) has been added for the Connect property that will allow the DAO Data Control to open Access 2000 databases. To obtain Visual Studio Service Pack 4 please visit the following web site:


Author Comment

ID: 6865133
Now I am getting the error code -2147217887

after I installed the newest version of jet and the service pack 5

this is the code I am using

void CDb11Dlg::OnOK()
     Csamp cb;





Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

LVL 23

Expert Comment

by:Roshan Davis
ID: 6867326
Csamp is derived from ?

LVL 23

Accepted Solution

Roshan Davis earned 300 total points
ID: 6867330
try this link
this contains the fix.


Author Comment

ID: 6868031
thanks for the extra help

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 120
repeatSeparator  java  challenge 13 57
countEvens challenge 2 97
Fibonacci challenge 11 120
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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

18 Experts available now in Live!

Get 1:1 Help Now