Solved

help with jet 4.0

Posted on 2002-03-13
6
274 Views
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

Thanks,

Bob
0
Comment
Question by:bebonham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 8

Author Comment

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

Expert Comment

by:Roshan Davis
ID: 6863542
MSDN SAYS

SYMPTOMS
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



CAUSE
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.





RESOLUTION
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.





STATUS
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:

http://msdn.microsoft.com/vstudio/sp

GOOD LUCK
0
 
LVL 8

Author Comment

by:bebonham
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;

cb.Open();
     

     cb.MoveFirst();
     cb.Close();
}

thanks

Bob

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

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

Roshmon
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 300 total points
ID: 6867330
try this link

http://support.microsoft.com/support/kb/articles/Q239/7/81.asp
this contains the fix.

GOOD LUCK
0
 
LVL 8

Author Comment

by:bebonham
ID: 6868031
thanks for the extra help
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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