Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Office 97 to Access Office XP

Status
Not open for further replies.

topcat1a

Programmer
Jan 6, 2005
34
GB
I have a VB application which was connected to a Access 97 database. I have recently moved from Office 97 to Office XP (Am now using Access in Office XP). When I run my VB programme I get an error message "Unrecognized database format 'C:/db1tables.mdb'" I get this error message prompted twice. Do I need to change the connections? This is what I have:

Dim db As ADODB.Connection
Set db = New ADODB.Connection
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1tables.mdb;Persist Security Info=False"
db.Open


db.Execute ("INSERT INTO table1(opcode, Section_test)VALUES('" & intNewHighest & "', ' ')")

Anyone know how to fix this error.
 
You may have a connection string problem.

Here's how I usually set my connection strings.

1. Right Click on your desktop.
2. go to New and then Text Document.
3. You will now have a 'New Text Document.txt' on your desktop. Right click on 'New Text Document.txt' and choose rename.
4. Rename the document to ConnectionString.udl
5. Now, double click the icon.
6. A 'data link Properties' page will appear. Set the provider and connection properties.
7. Click the 'Test Connection' button.
8. If the connection is succesful, click the 'OK' button.
9. The 'Data Link Properties' screen will close.
10. Rename ConnectionString.udl to ConnectionString.txt
11. Double Click the ConnectionString.txt icon.

You will see something similar to the following....

[oledb]
; Everything after this line is an OLE DB initstring
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My Documents\db1.mdb;Persist Security Info=False

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top