Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    4

    Red face Could not use ''; file already in use

    Hi

    I need urgent help. I cant get my hosting to resolved it.. says
    if it was a simple problem it would of been fixed? says the database
    is in full control but if more then one person accesses or
    I open 2 connections it fails.

    it was all working fine before the WIN2000 with sql97 and MDB
    access was upgraded to a WIN2000 with a separate sql2000 server box
    and a faster web server box

    <%
    'using the newer open methods to MDB
    response.write "This should work, multiple access (opens) to a MDB<br>"


    Set objConn2 = Server.CreateObject("ADODB.Connection")
    objConn2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\stats\data.mdb")

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\stats\data.mdb")

    'do nothing just a simple open and close


    objConn.Close
    Set objConn = nothing

    objConn2.Close
    Set objConn2 = nothing

    response.write "MS ACCESS MDB - multiple opens to the same DB Successful!<br>"
    %>

    ERROR given as follows
    Microsoft JET Database Engine error '80004005'

    Could not use ''; file already in use.

    /multimdbtest2.asp, line 10


    this is a simple ASP for testignonly the real code does 2 connections
    and worked fie for 12 months on a older server setup.. so I dont think
    its anything to do with coding after that fact.

    ANY CLUES ANY ONE?

  2. #2
    Join Date
    Nov 2002
    Location
    Ohio
    Posts
    90
    Hi pss2010,

    I get this error frequently while testing. It usually occurs when I have an object(Word, Access, Connection, etc.) open and the application fails due to a programming error. This leaves the object "hanging around" in the operating system since the "close and set to nothing" code was not executed. It makes the object look like you're already using it and cannot have a second copy of it.

    If you're having this problem on a new release of your PC/LAN/Server, check to see if the ODBC connections have been marked "reusable". I've only run into this once and don't remember if they should be set to yes or no.

    If the object in use was on my PC, I can clear the error by signing off and back on again. If the object in use was on the LAN/Server, I have to sign off and power down the PC to clear the error.

    I try to leave any application objects(Word, Access, etc.) minimized but visible. If my program fails, the application can be manually closed without rebooting. Saves a lot of time.

    Good Luck,
    Bruce Baasch

  3. #3
    Join Date
    Aug 2007
    Posts
    1
    I know this is an old thread but, If someone else finds this because of the same error the fix might be very simple for you and this could help... This error can be generated when the containing folder of the MDB does not give the IIS User Account authority to read and write in the directory. Right click on the folder and select the security tab. After doing so you will want to add the user which is something like (IUSR_MachineName). The only privileges that should be needed is Read & Write, no execute needed in many cases. Well I hope that this helps someone... Cheers!

  4. #4
    Join Date
    May 2009
    Posts
    1

    Solution

    Do following things and your error will be solved.

    In most of the cases this error comes due to disabled impersonation in web.config file.

    Add following things to enable impersonation in web.config file and your error will disappear.

    <configuration>
    <system.web>
    <identity impersonate="true" />
    </system.web>
    </configuration>


    Quote Originally Posted by pss2010
    Hi

    I need urgent help. I cant get my hosting to resolved it.. says
    if it was a simple problem it would of been fixed? says the database
    is in full control but if more then one person accesses or
    I open 2 connections it fails.

    it was all working fine before the WIN2000 with sql97 and MDB
    access was upgraded to a WIN2000 with a separate sql2000 server box
    and a faster web server box

    <%
    'using the newer open methods to MDB
    response.write "This should work, multiple access (opens) to a MDB<br>"


    Set objConn2 = Server.CreateObject("ADODB.Connection")
    objConn2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\stats\data.mdb")

    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\stats\data.mdb")

    'do nothing just a simple open and close


    objConn.Close
    Set objConn = nothing

    objConn2.Close
    Set objConn2 = nothing

    response.write "MS ACCESS MDB - multiple opens to the same DB Successful!<br>"
    %>

    ERROR given as follows
    Microsoft JET Database Engine error '80004005'

    Could not use ''; file already in use.

    /multimdbtest2.asp, line 10


    this is a simple ASP for testignonly the real code does 2 connections
    and worked fie for 12 months on a older server setup.. so I dont think
    its anything to do with coding after that fact.

    ANY CLUES ANY ONE?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •