How can I overwrite or unlock my Access database?

As part of the normal ODBC operation Microsoft Access databases are locked while in use. Before you attempt to break the connection you should be sure that it isn’t in use by any other users or visitors to your site. This might require you to put up ‘under construction pages’ where the database is being used on your site.

To force a break of the lock on the database you can write a page with an invalid query. This can simply be a typo in an existing query, etc. The invalid query will temporarily unlock the database so that you can overwrite the .MDB file. Remember that the database can be re-locked very quickly, so it might be a good idea to rename the .MDB file as soon as possible to ensure the database isn’t locked before you have had a chance to upload the new database file. If a valid query is made right after the bad query it is possible that the file will be locked again before you could rename it.

You may want to upload the updated copy of your .MDB file with a different name and have it ready for this process. This will minimize the amount of time your database is off line.

If you have tried this a few times with no success please contact our support staff and they will be happy to help you.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 2951