Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

help with jet 4.0

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
bebonham
Asked:
bebonham
  • 3
  • 3
1 Solution
 
bebonhamAuthor Commented:
can I see some sample code?
0
 
Roshan DavisCommented:
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
 
bebonhamAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Roshan DavisCommented:
Csamp is derived from ?

Roshmon
0
 
Roshan DavisCommented:
try this link

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

GOOD LUCK
0
 
bebonhamAuthor Commented:
thanks for the extra help
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now