Various

Access compact and repair an oversized file

Even if we will all agree to say that an Access database should certainly not exist to handle more than 2GB of data, but it can happen for some reasons that you end up with such database (Fig 1).

Access file exceeding 2GB
Fig 1 : Access file exceeding 2GB

For example, when you import external data in the database, after you deleted tables in the Access file, you still have to compact and repair it in order to clean the cache, and reduce filesize.

Nevertheless, with a 2GB Access file (Fig 1), when you try to compact and repair it (Fig 2), you end up with an error “Invalid argument” (Fig 3), which tells you that database is too big to be compacted – it exceeds maximum authorized filesize.

Access, compact and repair a file
Fig 2 : Access, compact and repair a file
Access, compacting error
Fig 3 : Access, compacting error

The solution that I propose you to get your database back is very simple, it is an other Access database to download, CompactAndRepairDB-vX.0.mdb[1], that will allow you to compact and repair the first one.

First, as compacting processus was started but not finished, you have to ensure that you will not end up with error message “Table TempMSysAccessObjects already exists.” (Fig 4).

Access, error after first compacting
Fig 4 : Access, error after first compacting

To do so, go in the options, and check the box “Systems objects” (Fig 5), which will show the table TempMSysAccessObjects (Fig 6), that you have to delete in order not to get the error message when you will compact the database (Fig 4)

Access, system objects display option
Fig 5 : Access, system objects display option
Access, system objects displayed
Fig 6 : Access, system objects displayed

Then, download file CompactAndRepairDB-vX.0.mdb[1], open it, and find your way to macros section (Fig 7). Double click on your favorite language (english, french, polish, spanish), and enter complete name of your file, path included (Fig 8).

CompactAndRepairDB-vX.0.mdb, language selection
Fig 7 : CompactAndRepairDB-vX.0.mdb, language selection
CompactAndRepairDB-vX.0.mdb, database to compact selection
Fig 8 : CompactAndRepairDB-vX.0.mdb, database to compact selection

Fill then the full destination name of the compacted database (Fig 9), that will be saved in root directory C:\

CompactAndRepairDB-vX.0.mdb, output file selection
Fig 9 : CompactAndRepairDB-vX.0.mdb, output file selection

Of course, this procedure needs an existing source file, which is checked thanks to Allen Browne code[2].