PDA

Click to See Complete Forum and Search --> : Still unrecognized DB format


jay19n64
Mar 16th, 2000, 10:48 AM
I put the code below in and it does the same thing(Unrecognized db format), do I change the code anywhere o0ther than the database path.

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

Wesam
Mar 16th, 2000, 02:20 PM
Hi,

- Make sure that the database file is not corrupted. You do
this by opening it by MS Access.
- If it is a good database, then try the following:

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

Private Sub Form_Load()
sPath = _
"C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
Set daoDB36 = DBEngine.WorkSpaces(0).OpenDatabase(sPath)
Set rs = daoDB36.OpenRecordset("Customers")
.
.
.
End Sub

regards,

Wesam

Clunietp
Mar 17th, 2000, 12:26 PM
Do you have references to BOTH DAO 3.51 AND DAO 3.6?

jay19n64
Mar 18th, 2000, 01:34 AM
it doesn't allow me to use both references only 3.6 or 3.51

Clunietp
Mar 19th, 2000, 12:18 AM
You are the first one to have a problem with this, and I've given the same MS support website to at least 20 people....and I've done it myself...it should work fine.....

If you want to send me your code, I would not mind taking a look

Clunietp@yahoo.com