PDA

View Full Version : Database error - URGENT


bostjank
01-15-2003, 11:19 PM
Hi there!

I really need urgent help with my problem. I have a web site that interacts with database. Everything works fine - or it worked - but now I noticed a problem and should resolve it in next couple of hours:

There is a form on a page and ith values are written to database on the action page. When opening the database I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Could not use '(unknown)'; file already in use.

/priporoci1.asp, line 168

This are the lines in question

166: strconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("...")
167: set conn = server.createobject("adodb.connection")
168: conn.open strconn

The thing is that I use EXACTLY the same code to open the database on the other pages on the site and those work perfectly OK. And, I tested the problematic page on my computer and didn't get any error.

Please help,
Bostjan

arnyinc
01-15-2003, 11:55 PM
It looks like you left out the name of your Access DB. Shouldn't it be something like server.mappath("../your_db.mdb")

bostjank
01-16-2003, 12:05 AM
Yes. I only replaced db name with ... in this post (bad experience), otherwise it is there. And it works on some pages and on my computer.

whammy
01-16-2003, 12:49 AM
Do you have the access database open on your computer? That will lock it in my experience, causing a similar error.

If not, or closing Access doesn't work, try making a copy of it (under another name), uploading it to the server, and changing your script to reference the copy... I don't know if that will work, but since it seems to me like the file may perhaps be locked by some program which is accessing it, it can't hurt to try. :eek:

P.S. Make sure you do a hard refresh (CTRL+F5) when checking the page in a browser... again, I dunno if it will make any difference, just throwing out ideas here because it's urgent. :)

I've also heard about (but not experienced) problems like this with another program accessing the file, such as an antivirus program, which locks it indefinitely... just something else to look at, I would check out what programs are running on the server if the above things don't work to see if you can find out why the database is locked, and what program is accessing it.

If any of that doesn't work, I tried! It's really hard to troubleshoot an error like that if you aren't there in person. :(

arnyinc
01-16-2003, 03:28 AM
Looking around, it sounds like it is a permissions problem. Since it appears to be working in other places, this probably isn't the problem though.

http://support.microsoft.com/default.aspx?scid=KB;en-us;q202171
http://support.microsoft.com/default.aspx?scid=KB;en-us;q174943

Are you explicitly closing all your connections at the end of every page?

There's a couple things to think about at least. :confused:

bostjank
01-16-2003, 05:58 AM
Actually it was a permissions problem - permission was not set on the LDB file (my provider wont give permissions on the whole folder).
Bu I can't figure it out why it worked on some pages - is it possible that lDB file is not accessed every time?

Bostjan