Repairing Access
HomeRepairing AccessThis page

How to repair a Microsoft Access database by using “Import”

3D window of “Obtain external data” in Microsoft Access

David Cimadevilla

Jul 19, 2019

Step-by-step mini-tutorial on how to use “Import” to repair a corrupt Microsoft Access database.

You have just tried to repair your Access database by applying "Compact and Repair" but it did not work. Despite the attempted repair, there are still errors or some objects are inaccessible.

If you find yourself in this situation, exporting all of the objects to a new database could solve the problem. If you want to try it, here are the steps to follow:

Importing all objects

  1. Create a new database

    From the File menu, click New | Blank Database.

  2. Name it

    In the dialog box that appears, type the name you want for the repaired database. You may use something like database-REPAIRED.

  3. Discard "Table1"

    Close Table1 to discard it. This is the empty table that is automatically created with any new blank database.

  4. Select a new data source

    From the External Data menu, select a new data source.

  5. Select your file with errors

    A dialog box opens. Select your file with the Browse button, check Import tables, queries, (...) and Accept it.

  6. Select all tables

    On the Tables tab, click Select All.

  7. Select all queries and other objects

    Repeat Select All in the tabs Queries, Forms, Reports, Macros and Modules until everything is selected.

  8. Import them!

    Once all of the objects have been selected, click on Accept. You will see how all the objects are being imported.

  9. Close the final window

    When the import is finished, close the window.

  10. Done!

    All objects have been imported and, if all goes well, we will have repaired our database.

What if the import fails?

This process is not always completed without incident. The process can be stopped if an error occurs, for example, at the time of selecting the damaged database.

Microsoft Access error: '...' is not an index in this table

Sometimes an error message aborts the import.

If this happens, you can still do it another way: by exporting instead of importing. This is the process:

Exporting instead of importing

Importing, as previously explained, is much easier and thus prefered. However sometimes this procedure is not feasible because an error halts the process.

Exporting is an alternative that consists of opening the damaged database and export the objects one by one.

The main disadvantage is that it can be a laborious task if you have a lot of tables and objects. Beside which, objects that generate an error, because they are damaged or have some problem, can not be exported.

The good news is that we will be able to save everything that is in good condition. The database may not be complete but at least we will have a clean starting point to repair it manually.

The process is identical in the first 3 steps and then changes:

  1. Create a new database

    From the File menu, click New | Blank Database.

  2. Name it

    In the dialog box that appears, type the name of the repaired database. Call it something like database-REPAIRED.

  3. Discard "Table1"

    Close Table1 to delete it. This is the empty table that is automatically created with the new database.

  4. Open damaged database

    From the File menu, open your damaged database.

  5. Start the export of the first table

    Select the first table and export it. Unfortunately it is not possible to select more than one table at a time, so you will have to do it one by one.

  6. Select destination file

    Click Browse, select the empty file you have created earlier, and click Accept.

  7. Leave the name of the table as it is

    In the export options, leave all default settings and Accept.

  8. First table exported!

    The table has already been exported. Close the window and ignore the option Save export steps which is not of any help.

  9. Repeat with all objects

    Select the second table and repeat the previous steps. Then repeat with all the tables, and then with the other objects until you have exported them all.

    This may be quite laborious but, unfortunately, Access does not allow you to export more than one object at a time. A more convenient and powerful alternative is to use an Access repair tool.

  10. Open the final database

    Once all the objects have been exported you can open the destination database.

  11. Check the new database

    All the exported objects will be in the new database.

And if it still doesn't work for me?

Using Compact and Repair or import every object into a new file, are not the panacea of data recovery.

Access is very sensitive to badly formed, incoherent, or damaged data that it will no be able to recover. You will always get better results using a data recovery tool.

By the way, optimal results are obtanined when you recover your data from the original corrupted file and before applying Compact and Repair to the database.

You can find more information about Access data recovery at Repairing Access.