Access database cannot b opened?

toughcoder
10-21-2004, 09:58 PM
Greetings every1,
I'm having Office XP, and used Access to create a DB. Afterwards I used the following code to open it.

Dim DB As Database
Dim RS As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase("C:\db1.mdb")
Set RS = DB.OpenRecordset("table1")
Text1.Text = RS.Fields(0)
End Sub


It gives the error "Unrecognized database format". Why is this. If I create a DB from within VB's Visual Data Manager, it works fine. What shld i do. My OS is Win2k...

Dennis DVR
10-21-2004, 10:37 PM
Greetings every1,
I'm having Office XP, and used Access to create a DB. Afterwards I used the following code to open it.

Dim DB As Database
Dim RS As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase("C:\db1.mdb")
Set RS = DB.OpenRecordset("table1")
Text1.Text = RS.Fields(0)
End Sub


It gives the error "Unrecognized database format". Why is this. If I create a DB from within VB's Visual Data Manager, it works fine. What shld i do. My OS is Win2k...

dowloading the newest sevice packs and mdac_type might solve the problem

toughcoder
10-21-2004, 11:14 PM
Hey duane, i already have the latest packs & patches. THis code worked fine with Office 97. :confused:

Dennis DVR
10-21-2004, 11:42 PM
Hey duane, i already have the latest packs & patches. THis code worked fine with Office 97. :confused:

then reference the DAO 3.6 if you are using Access 2000 and above, 3.51 would not work in a higher version of access.

toughcoder
10-22-2004, 01:02 AM
Will give that a try. Thanx :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum