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
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