Could not use 'C:\temp\myDB.mdb'; file already in use.
Of course Access help provided nothing, so hopefully this will help you. Turns out that you need to have EXCLUSIVE ACCESS to the file, so it is guaranteed that no one else is using it, in order to compact and repair it. Here is how you do that:
- Open Access, but not a specific database.
- On the File tab, click Open.
- Navigate your file system to the database you want.
- Instead of clicking the Open button, click the dropdown on the button.
- Choose Open Exclusive.
- With your database now open, choose File, and then Compact and Repair.
Hope this helps some user out there...