TESTING AND REPAIRING CORRUPTED JET BACK-END DATABASES

Section 6 of the ap_AppInit() function deals solely with handling the repair of the back end if it requires it:

  Case apErrDBCorrupted1

     '-- Section 6: Backend Corrupted. Repair?
     Beep

     If MsgBox("The Backend Database is Corrupted." & vbCrLf & _
        vbCrLf & "Would you like to log users out and " & _
        " attempt to compact/repair it?", vbYesNo + vbCritical, _
        "Corrupted Backend!") = vbYes Then

        DoCmd.OpenForm "ap_CompactDatabase", acForm

     Else

        flgLeaveApplication = True

     End If

End Select

This code hasn't changed from the DAO version.

Note

One big change that has occurred with Jet is that you no longer use Compact and Repair to perform the separate functions. They're combined in the CompactDatabase ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.