Rick Hurst Web Developer in Bristol, UK

Menu

Access Compact and Despair Utility

An asp/ MS Access web app of mine suddenly stopped working, and was throwing an error:-

Microsoft JET Database Engine error ‘80004005’

The Microsoft Jet database engine cannot open the file ‘C:foobar.mdb’. It is already opened exclusively by another user, or you need permission to view its data.

I knew that it wasn’t opened by another user, so it must be related to the permissions. I remembered the previous day I had run “compact and repair” in the Access GUI to bring the database size down. Running this as administrator via the GUI in situ on the server seems to remove the permissions for the IUSR_(your server name) account. You can add permissions back in for that user via the security tab for the file (if you have access to the server gui).

One way to avoid this is to run the compact and repair procedure from an asp script like this one. This seems to do the trick without breaking anything