Unrecognized database format

  • Thread starter Thread starter timmso
  • Start date Start date
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
 
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.
 
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
 
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.
 
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.
 
Just make up a test database with one table which has a couple of records
and see if you can access that.
 
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.
 
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
 
Back
Top