Dealing with error “Microsoft Access has detected corruption…” in MS Access
This article describes you how to deal with MS Access error message saying,
Microsoft Access has detected corruption in this file.
Microsoft Office malfunctioning, OS malfunctioning, software damage, file system damage, virus attacks, unexpected system shutdown, etc. are the well known reasons for corruption in MS Access database.
Let’s consider that there is an Access database named Employee. Due to corruption in the database, Employee database stops to mount and you get error message saying:
“Microsoft Access has detected corruption in this file. To try to repair the corruption, first make a backup copy of the file. Then, on the Tools menu, point to Database Utilities and click Compact and Repair Database. If you are currently trying to repair this corruption then you will need to recreate this file or restore it from a previous backup.”
Moreover, whenever you try to access this database you get the same irritating message again.
Reason:
Reason behind this behavior is corruption in the Employee database.
Resolution
To resolve the above error message and access the data stored in the Employee database, you will need to follow these steps:
Create a blank database = “C:\ Recover_db.mdb”. Close and exit.
Create another blank database and navigate to Modules Tab.
Click on New and Paste the given below code
Dim db As DAO.Database
Set db = DAO.OpenDatabase(”C:Corrupt_db.mdb”)
Dim xtable As TableDef
For Each xtable In db.TableDefs
If Mid(xtable.Name, 1, 4) <> “MSys” Then
rSQL = “SELECT * INTO [” & xtable.Name & “] IN ” & _
“‘C:Recover_db.mdb’” & _
” FROM [” & xtable.Name & “]”
db.Execute rSQL
End If
Next xtable
MsgBox “Process Complete.”
End Function
Go to Menu tools, select References “Microsoft DAO 3.6 Object Library”. Click OK.
In Module Window, click on Recover_db() Function.
Check database file names, after proper setup and press the F5 button.
Tables and data from corrupt database are recovered and saved to new database.
Or you can use an inbuilt repair utility named “Compact and Repair”. One can’t bet
on it as this utility most of the times fails to access repair. In such a scenario, you are left with option of recovering corrupt Access database using Access Database Repair software. Kernel for Access recovery is the smartest software available in the market.