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...
Joshua
I want to distribute an Acess 2010 application with a split database. In the best of all worlds, I would like both databases to compact and repair automatically (part of autoexec or the quit macro). Users will be using Access runtime, they will most likely not have full MS-Access installed on their machines so they can't run compact and repair on either database. Do you know of any code that will do that?
ReplyDeleteThis used to work in Access:
ReplyDeleteFunction CompactThisDB()
Dim conCompact As Office.CommandBarControl
Set conCompact = CommandBars.FindControl(ID:=2071)
conCompact.accDoDefaultAction
End Function
But now it says cannot compact in code or VB. Does anyone have any thoughts?
Get Access File Recovery Software is an efficient utility to bring all the corrupt or inaccessible ACCDB and MDB files back to life and fix all the minor and major database bugs and errors. It supports Microsoft Access version 95/97/2000/XP/2003/2007/2010/2013. The GUI of the software is very simple and new users easy to use. To download : http://www.filesrecoverytool.com/access-file-recovery.html
ReplyDeleteThanks, this is something that has plagued me for a long time, never noticed the Open Exclusive option, but it works every time!
ReplyDeleteI would like to suggest this application, which will repair your access data in trial version and see you the preview of recover data.
ReplyDeleteTry:- http://www.mannatsoftware.com/stellar-phoenix-access-recovery.html