Database repair

How to repair a corrupt Microsoft Access database

A corrupt database is alarming, but it usually isn't the disaster it first appears. Here's how to recover it safely, what causes corruption in the first place, and how to stop it happening again.

A screen full of red error messages, representing a corrupt database

First, don't panic and don't keep hammering the file. Every time you force a corrupt database open and closed you risk making the damage worse. The single most important step is to make a copy of the file before you do anything else, so you always have the original to fall back on.

Step 1: Make a backup copy

Close Access completely. Find the database file (usually an .accdb or older .mdb) and copy and paste it so you have a second, untouched copy. All the steps below should be done on a copy, never your only version.

Step 2: Try Compact and Repair

Access has a built-in tool that resolves a surprising amount of minor corruption and bloat:

  1. Open Access without opening the database (open the Access program first).
  2. Go to Database Tools → Compact and Repair Database.
  3. Select your copied file when prompted.

Access rebuilds the file, discarding wasted space and fixing minor index damage. If it opens cleanly afterwards, you may be done, but read on, because if it got corrupt once it will usually do it again unless the cause is addressed.

Step 3: Import into a fresh database

If Compact and Repair won't complete, create a brand-new blank database and use External Data → Import to pull your tables, queries, forms and reports out of the damaged file into the clean one. Often the corruption is confined to a single object, and importing everything else recovers the bulk of your work.

Step 4: Recover the data if objects are damaged

If a table itself is damaged, import just the data into a new table, or recover from your most recent good backup and re-enter only the records since. This is where having regular backups pays for itself, and where a specialist can often recover more than the built-in tools manage.

What actually causes Access corruption

Corruption is rarely random. The common causes are:

  • An unsplit database shared over a network. If several people open one shared file directly, a dropped connection mid-write can corrupt it. The fix is to split the database into a back end (tables) and a front end (forms and reports) each user runs locally.
  • Unreliable network or Wi-Fi. A connection that drops while Access is writing is a classic cause. Wired connections are far safer for shared databases.
  • A bloated file. Databases that are never compacted grow huge and become fragile.
  • Hard shutdowns. Power cuts or killing Access while it's writing.
If your database gets corrupt more than once, the corruption is a symptom. Fixing the file without fixing the cause just resets the clock.

How to stop it happening again

  • Split the database if it's shared, so each person has their own front end.
  • Back up automatically and regularly, and test that you can actually restore from a backup.
  • Compact regularly to keep the file lean.
  • Consider moving the tables to SQL Server or Azure SQL if lots of people share the database. A proper database server is far more resilient to the connection drops that corrupt Access files, and your forms and reports can keep working unchanged. We cover this in when to upgrade Access to SQL Server.

When to call a specialist

If Compact and Repair fails, the file won't import, or the same database keeps corrupting, it's worth getting an expert on it before you lose data. Choose carefully: see why database repair in the UK can be safer than going offshore. We can usually recover more than the built-in tools, and more importantly we find and fix the underlying cause. Our database support & recovery service starts with a free audit, so you'll know where you stand before spending anything.

Prefer a step-by-step walkthrough for your exact situation? Try our free Access Database Repair Assistant: answer a few questions and it builds a tailored recovery plan in the right order, with warnings for the common causes. It runs in your browser and never uploads your file.