PDA

View Full Version : Sporadic database error with ASP/Access


Cam
05-14-2003, 03:17 AM
Hi all

I get the following message from running an ad rotation script:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.

/cgi-bin/banners.asp, line 5

Line 5 is a DSN-less connection.

The weird thing is, this error is very sporadic. The script worked fine when the page first went up and works fine locally (PWS) with the same database the error says is corrupted. Online, the error seems to come and go. I replaced the include that contains the banner script to keep the page up and periodically checked the include directly. Suddenly, it worked fine, without me doing anything. This has happened once before, again resolving spontaneously.

The site is hosted virtually and the ISP was unable to reproduce the error the first time this happened. The database is relatively small (200k) and contains the ad links, click counts etc.

Any ideas what could be causing this? I'm at a bit of a loss as the scripting seems fine...

Cheers

Cam

Bullschmidt
05-14-2003, 05:58 AM
Cam,

It sounds like there might be a problem with the path of the database in the connection string.

arnyinc
05-14-2003, 02:17 PM
IUSR needs permissions to your temp directory. Here's an overly detailed decription.

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=115

Cam
05-14-2003, 02:53 PM
Hi Paul

You'd think that would be true except that the pages actually work most of the time... .

However, following up on your thought, I think I may have found the answer: the Access ODBC driver is not thread safe

http://dbforums.com/t553649.html

Looking at my asp, the ad (a freeware program I got, uses the Access driver), the pages that I wrote that work fine all the time, use the Jet OLE DB provider.

Looks like I found the problem.

Arnyinc, thanks for the heads up. Permissions may not be at the root of this as the problem is sporadic. I did follow up with the ISP in the first instance about permissions (as the site is virtually hosted) and they said it was "fine". They aren't the brightest bananas in the bunch, so I may have to revisit them if switching the drivers doesn't help. Thanks much.

If it resolves with the tweak, I'll post a note up...

Cheers

Cam

Cam
05-15-2003, 01:42 AM
Well, so much for that theory. Still refuses to connect remotely, even after changing over to Jet.... hrmmm....

What's odd is that other databases in the same directory connect fine... Wouldn't access to the temp directory, as suggested by anryinc affect every connection, not just one to one specific database?

The database definitely is not corrupt, the identical one works fine locally....

I've read some FAQ's that Access can't accept more than 20 simultaneous users, which could easily be a problem in my scenario as the database is used for banner ads on most of the pages I have. Still doesn't explain why I can't access an off-line setup up, unless there's a "safety valve" somewhere that blows....

Any thoughts would be appreciated.