Modernize Studio
Language: English
Get a free proposal

Microsoft Access

Corrupted Access database: recovery and prevention

Access will not open the file or shows strange errors? Copy it first: here is how to recover the data and avoid a repeat.

By Modernize StudioUpdated 5 min read

In short

  • Do not work on the damaged file: copy it straight away and make every attempt on the copy.
  • The first tool is Compact and Repair, which is built into Access.
  • If that is not enough, import the tables and forms into a new database, or restore the latest backup.
  • Damage almost always comes from an interruption while writing: an unstable network, Wi-Fi, computers switched off with Access open.
  • A split database, a wired network and regular backups cut the risk a lot. If the damage keeps coming back, the data should move to SQL Server.

Signs of a corrupted database

  • Access will not open the file and reports “Unrecognized database format”.
  • When the file opens, Access offers to repair the database by itself.
  • Some rows in a table show strange characters or text instead of the data.
  • Forms or VBA modules no longer open, or the code has disappeared, while the data is still there.

Note: the format error also appears when an .accdb file is opened with a version of Access that is too old, such as Access 2003. In that case the file is fine and you only need a newer version.

According to Microsoft, damage to the design, meaning code and forms, is more common than data loss, which is rare and usually limited to the last change that was interrupted.

The first thing to do: a copy

  1. Get everyone out

    Ask colleagues to close Access, so nobody writes to the file while you copy it.

  2. Copy the damaged file

    Copy it to another folder with a name that sets it apart, for example with the date. Every recovery attempt is made on a copy.

  3. Check the lock file

    If a file with the same name and the .laccdb extension stays next to the database even with Access closed on every computer, a session ended abruptly. It can be deleted: Access creates it again next time the database opens.

Microsoft warns that during a repair Access may truncate data from damaged tables. Without a copy, whatever is lost cannot be recovered.

1. Compact and Repair

This is the repair tool built into Access. Use it when only one person has the database open, after making the copy.

  1. If Access opens the file

    File › Info › Compact & Repair Database. Access creates the compacted version in the same folder.

  2. If the file will not open

    Start Access with a blank database, close it with File › Close, then choose Database Tools › Compact and Repair Database and select the damaged file.

  3. If Access offers to repair

    Answer yes. Then check the content: if the repair is partial, Access lists the objects it could not recover in a system table called MSysCompactErrors.

The order of the attempts: move to the next one only if the previous one is not enough.

2. Import everything into a new database

If Compact and Repair is not enough, the damage often affects only some objects. Create a blank database and import the objects from the damaged file, through External Data › New Data Source › From Database › Access, choosing to import.

  • Import the tables first: they are the data, the part that matters most.
  • Then queries, forms, reports and modules. If an object gives an error, skip it and make a note.
  • Check the relationships between tables and the database settings, and recreate them if they are missing.

A damaged form or module can often be recovered from an older copy of the front end: that is why it pays to keep dated versions of it.

3. Restore the last good backup

If important tables cannot be recovered, the most recent backup remains. Data entered after that backup has to be rebuilt, for example from documents, emails or invoices. That is why how often you back up matters as much as backing up at all.

Would you like an opinion on your case?

Send us the file: within 48 hours you receive a free written assessment, even if the answer is that a small fix is enough.

How our prices work

How to stop it happening again

Microsoft explains that damage is more likely when the file is shared on a network and several people work in it at once. The habits that reduce it:

  • Split the database: any damage usually stays in one user's front end, which can be replaced in a minute. We explain how in the guide to Access slow on a network.
  • A wired network: no Wi-Fi or VPN for working on the shared file.
  • No OneDrive or SharePoint for opening the database: Microsoft advises against it.
  • Close Access before switching off the computer, and protect the server with a UPS.
  • Automatic daily backups of the back end, taken when nobody is using it and kept for several days.
  • Compact and Repair regularly, always after the backup.

If the damage keeps coming back

Occasional damage can happen. If it happens every month, the database has outgrown what a shared folder can handle: too many users, too much data or an unsuitable network. The route is to move the data to SQL Server, which handles several users writing at once safely and allows backups while people work, or to move the program to the web.

With our free database check you can see how many tables, forms, macros and modules your file contains, without it leaving your computer.

Frequently asked questions

Can Compact and Repair make things worse?

It can truncate data in tables that are already damaged, as Microsoft points out. That is why it should always be run after making a copy of the file.

How often should Compact and Repair be run?

It depends on how much the database is used: in many offices once a week or once a month is enough. Always when nobody is using it, and after a backup.

Can Compact on Close be turned on?

Yes, on databases used by a single person. Microsoft warns that in databases used by several people it can get in the way of the others' work.

Are there programs that repair Access files?

Yes, but try the Access tools and the import into a new database first. If you use an external program, always work on a copy and check who makes it.

Is the file damaged, or is it just a different version of Access?

If the file is .accdb and you open it with Access 2003 or earlier, the error is normal. Try opening it with a recent version before assuming it is damaged.

Sources

  1. Microsoft: compact and repair a database
  2. Microsoft: split an Access database
  3. Microsoft: ways to share an Access desktop database

Official Microsoft pages.

Related guides

Related services

All guides

Contact

We work in writing: everything stays on record, so you can show it to your accountant or your IT person.

Send us your file

  1. Make a copy of the file; test data is fine.
  2. Attach it to your message. If you would like a non-disclosure agreement first, write to us without attaching the file.
  3. Within 48 hours you will receive the free written assessment and the price of a pilot module.

We work from Italy.

Describe your project in a few lines

A small request is fine too. If anything is missing, we will ask you.

Fields marked * are required.

For example: what the database is used for · number of users · Access version, if you know it · is it split into a front end and a back end?

Attachment(optional)

Databases, Excel files, screenshots or a specification. For larger files, include a download link in your message. We only work on copies and delete them at the end of the project, with written confirmation.

Reply within one working day. Free proposal, no obligation.

Get a free proposal