ADO Error - database is corrupt.

O

omsoft

I have the following code. I get an error as conn.open line.
This happens on various machines which run the app. This code is invoked
from an Excel front-end and gets data from Access back-end which is
referenced by \\server\folder.
Any help would be greatly appreciated.
The error is as below.
Error **************
Run-time error -2147467259 (80004005)
Cannot open database ''. It may not be a database that your application
recognizes, or the file may be corrupt.

Code ***************
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strConn, strDB, strSQL, strData, strIcao, strFbo As String
strDB = rulesPath
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strDB & ";User Id=admin;Password=;"
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.Open (strConn)
conn.CursorLocation = adUseClient
rs.Open strSQL, conn, 1, 3
strSQL = "SELECT * FROM tbl_Volumes "
rs.Open strSQL, conn, 1, 3
histIcaoQty = 0
If rs.RecordCount > 0 Then
rs.MoveFirst
While Not rs.EOF
histQty = histQty + rs("Volume").Value
rs.MoveNext
Wend
Else
histQty = 0
End If

rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
 

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

Top