Unrecognized database format

T

timmso

I'm using Ado.net in an asp.net project with an Access backend.

Whenever I try to do a simple Select or Update, I inevitably see the error
"Unrecognized database format". I'm using Access 2000.

Here is some code for an aspx page:

Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _
"data source=D:\Data\Codelib\codelib.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT CodeID, Title from tblCode;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
Repeater1.DataSource = objCommand.ExecuteReader()
Repeater1.DataBind()
objConnection.Close()
End Sub

So when I run this a few times, it works fine. Then I get that error message
and the code no longer works. The error occurs on line

objConnection.Open()

Can somebody please tell me what I must to to alleviate this?

Thanks for any pointers.

Tim
 
W

William LaMartin

Are you sure you are using an Access 2000 database? I bet the file is
really an Access97 version. Then if the server has MDAC 2.6 or higher, I
believe, you will get this kind of error.

In the past, I had some sites that used Access97 databases and the web host
upgraded to a higher version of MDAC than 2.5 (I think it was) resulting in
that sort of message. When I updated the databases to Access version 2000,
the error message disappeared.
 
T

timmso

Thanks for responding.

I'm positive that it is an Access 2000 database. I created it on my machine
and got the error here first. Then I tried a compact/repair and the error
temporarily disappeared. I uploaded the DB to my web host and got the error
again after I ran several select and update queries.

So I exported the tables into a fresh Access 2000 DB and uploaded that to my
web host, and the error is happening all the time now.

In addition, I have also been seeing an error intermittantly when trying to
update a record:

"Search key was not found in any record."

This only happens with ONE particular row in my table.

Thaks for any more info.

Tim
 
W

William LaMartin

Perhaps it is a corrupted database. Why don't you try the same code with a
fresh test database that has nothing to do with the one giving you the
trouble. Make sure it has a primary key also.
 
T

timmso

Do you mean not to export the tables from one db to another, but just
recreate the db from scratch?

Also, it does have a primary key.
 
W

William LaMartin

Just make up a test database with one table which has a couple of records
and see if you can access that.
 
T

timmso

Ok, I have created a brand new database and am trying it out. So far it
seems OK. I'll have to play around with it and see how it goes.

Thanks for your help.
 
H

han4

timmso said:
Thanks for responding.

I'm positive that it is an Access 2000 database. I created it on my machine
and got the error here first. Then I tried a compact/repair and the error
temporarily disappeared. I uploaded the DB to my web host and got the error
again after I ran several select and update queries.

So I exported the tables into a fresh Access 2000 DB and uploaded that to my
web host, and the error is happening all the time now.

In addition, I have also been seeing an error intermittantly when trying to
update a record:

"Search key was not found in any record."

This only happens with ONE particular row in my table.

Thaks for any more info.

Tim


resulting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top