This is a follow-up from a PAQ where I ~thought~ I got the answer: I keep trying to compact a MDB whose tables are attached to a front-end. But a lock stays up to prevent my compacting it.
I've no problem with unattaching the tables AND closing all my forms before I get to work with a DBEngine.CompactDatabase(...) call, I even run a 'Doevents' call just in case. But oddly enough Access still gives me a 'User so-and-so (me) has already opened the database' or some such.
Now I really don't understand this: The files are on my local disk so network issues are moot, I'm the only user, there are no tables attached (anymore) and I've closed all my forms. Why can't I compact it then?!?
And a better question yet: What do I need to do to successfully compact that datafile from the front-end MDB?