Forum Discussion
lytell
May 06, 2021Copper Contributor
Compact & Repair throws error saying file is in use
When trying to compact and repair any database created on my computer i get an error saying file is already in use. I have tried every possible way to fix this - reinstalled Office 365 tried multiple...
isladogs
May 06, 2021MVP
Hmm. It can happen when code is running in the background but certainly shouldn't happen in the latter case.
It sounds like you may have another copy of Access running hidden in the background.
Close your Access database normally. Does the lock file get deleted? Now run Task Manager, change to detailed view and check for any running instances of Access. If you find any, click End Task.
Reopen your Access database & try to compact again.
If it still fails, first repeat the above, then open your database with the shift key held down to bypass any startup code. Now compact it. Any luck?
- isladogsMay 06, 2021MVPHmm. Very odd.
Was the lock file deleted? Did you find any running instances of Access in background processes?
If you try to make changes to a database do you get any warnings that there is another copy already running?
One last try. Use the Run command to compact it. To do so, you need to type the Access program file path followed by your application file path followed by /compact and enclose both sections in quotes. Does that make sense?- lytellMay 07, 2021Copper ContributorWas the lock file deleted? Did you find any running instances of Access in background processes? NO
If you try to make changes to a database do you get any warnings that there is another copy already running? NO - lytellMay 07, 2021Copper ContributorSame Error message. This is insane.
- isladogsMay 07, 2021MVPYes I agree but please could you answer each of my questions from my last post