开发者

Access Error 3443: Unrecognized database format 'databasename.mdb'

What could be the cause of the above error when trying to use an MDB file from a VB app?

The access version of the MDB file is 6.68.

I have a feeling this might have been caused by someone trying to open the .mdb开发者_开发技巧 file from a newer version of Access and it may have corrupted the MDB.

How can this problem be solved?


Here is some VBScript which, hopefully, will get a version for you. Save this in an ordinary text file with a vbs extension and drag and drop an mdb onto it. This is a very quick sketch, and only roughly tested.

Set fs = CreateObject("Scripting.FileSystemObject")

If WScript.Arguments.Count > 0 Then
    sPath = WScript.Arguments.Item(0)
Else
    sPathTemp = Left(WScript.ScriptFullname, _
        InStrRev(WScript.ScriptFullname, "\"))

    sPath = InputBox("Enter Path and Name of .mdb", "Get Ver", sPathTemp)
End If

If sPath = "" Or fs.FileExists(sPath) = False _
    Or Right(sPath, 4) <> ".mdb" Then

    MsgBox "Not a valid file: " & vbCrLf & sPath, 64, "Get Ver" 
Else

    Set cnnDB = CreateObject("ADODB.Connection")
    cnnDB.Provider = "Microsoft.Jet.OLEDB.4.0"
    cnnDB.Mode = 1 ''adModeRead

    On Error Resume Next
    cnnDB.Open sPath

    If Err.Number <> 0 Then
         MsgBox "Error"
    Else
        MsgBox "4 = Access 97, 5 = Access 2000 (2002?)" & vbcrlf & _
        "Value for " & sPath & " is: " & _
        cnnDB.Properties.Item("Jet OLEDB:Engine Type").Value
        cnnDB.Close
    End If
End If


"Unrecognized Database Format" errors are typical of corruption, though they are also associated with opening a database with an older version of Access that was created in a newer version of Access (or possibly, in your case, with a connection string that references an older version of Jet).

According to the Access Wiki, there's no such thing as Version 6.68. Not for Access and not for Jet, so you're going to need to figure out which version you have and then determine which version of Jet you need to make the connection.

Note that if you are using Access 2007, an accde or mde created in Access 2007 SP1 can't be read in Access 2007 without installing the SP.

If it does turn out to be corruption, I would encourage you to create a new, fresh DB in a different folder. Import the tables, queries, forms, etc... into the new DB, perform a Compact and Repair, and then test the new DB to ensure it is free from corruption.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜