Web Hosting Talk







View Full Version : Access DB error: Cannot open Database ''


DTMark
10-13-2003, 07:59 AM
Hi,

A number of sites we host use Access databases. Most are fine, but two of them in particular occasionally stop responding which causes the ASP page and the raw log to show the error:

80004005 Cannot_open_database_''.__It_may_not_be_a_database_that_your_application_recognizes__or_the_file_may_be_corrupt

I've been through MS Product Support and checked every possible resolution (permissions, shares etc) and it's none of these - I can rule everything out.

I know that Access databases aren't suitable for use with Web applications since they're not multithreaded but smaller sites can normally get away with it as they don't have much concurrent access - in fact these two sites are quiet and the problem isn't related to overload.

In fact it really doesn't seem to be related to *anything* - the databases just stop working occasionally for no reason. Rebooting IIS seems to release a lock on the file which resolves the issue.

Any ideas on what might be causing this from anyone who's seen it before? Many thanks.

andy18
10-13-2003, 12:47 PM
Hi,

What version of access you are using for the database?Access 97?

DTMark
10-13-2003, 01:00 PM
The database which causes the most problems appears to be an Access 2000 database (I downloaded it locally to have look, and to check that it wasn't set to "Exclusive mode" which would have explained things)

The database has no queries, no forms - just 3 tables, and that's it. It isn't even a large database.

The page which usually throws the error (though it affects all pages) just does a simple select on one of the tables.

It can work fine for days sometimes weeks, then it breaks, and IIS needs restarting before it will come back.

My suspicion is the the locking file becomes corrupted. I'd assumed this sort of problem was just "normal" with Access databases as they shouldn't be used for web sites anyway, but given the frequency with which it occurs I suspect something is amiss somewhere.

TXsys
10-13-2003, 08:34 PM
Take a look at the recommendations from Microsoft here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;300216

In particlular, whenever I have encountered corruption problems with an Access database, the first thing I suspect is the "opportunisitic locking" setting on the server. This feature, enabled by default, does not play well with multiple users hitting an Access database.

Follow the instructions in the page I linked to above for instructions on how to edit the registry on the server to disable opportunistic locking.

Note that even if this cures the root cause, you still will probably have to recover the database from an uncorrupted backup.

I have never used Access as web back end, but the oplocks problem above has caused problems for me on fileserver-based Access apps. The registry edit cured the problem.