Link to home
Start Free TrialLog in
Avatar of JudithARyan
JudithARyanFlag for United States of America

asked on

Access 2003 Compact cannot find database

I have a macro that does a RunCommand where Command is CompactDatabase.  I get the error message:

The Microsoft Jet database engine cannot open the file 'C:\Users\Judith\CARE2.8\db1.mdb'.  It is already opened exclusively by another user, or you need permission to view its data.

The file db1.mdb doesn't exist.  The file I'm trying to compact is CareProgram.mdb.  Where is the db1.mdb coming from?

Judith
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

The Compact and Repair creates a new db1.mdb with your data compacted, then deletes the original, and then renames db1.mdb as your database. You cannot compact your database while you are in it via a macro or code.

Kelvin
You can however do this with an AutoKeys Macro, using Sendkeys
(do a web search of:  Sendkey issues
...to learn about the concerns when using SendKeys)

Something like: %TDC

Not near my Access 2003 box right now, but I am sure another expert can finish this off for you...
Have the Permissions on the folder 'C:\Users\Judith\CARE2.8 changed at all recently ??

Are you SURE the db is not open in another instance ?

Do you see an LDB file in that folder ?
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial