OLEDB - Error File in Use

Discussion in 'Databases' started by tmeyer, Mar 3, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am trying to convert my asp pages from ODBC to OLEDB. My connection is working however, I am getting the following error when I am attempting to open a cursor or list of records on the access database.

    My error is the following:




    Microsoft JET Database Engine error '80004005'


    Could not use ''; file already in use.


    /report2.asp, line 25





    Is this a permissions problem?


    Thanks


    Tim
     
  2. ensure that you've closed all connections before attempting to make another.

    also, it is very important that you realise that Access is not really meant to be used for the web as you will find yourself with tons of problems when attempting to insert while it's being read. Also commonly you'll find problems with IIS not quite releasing the Access database (eg. unlocking it). This can seriously cause problems with multiple users accessing the database at one given time.

    anyways; in this case it might actually be a permissions problem..read this article for more information and on how you can fix it:
    http://support.microsoft.com/kb/174943/EN-US/





    ----
    Brian H. Madsen
    Microsoft SQL Server IG Perth - Organiser
    http://www.sqlserver.org.au
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Most developers do close database connections but a very common mistakes I've seen a lot is that they do not realize database connections are kept open if the page crashed.

    For example,

    objConn.open

    ' do stuff here....

    objConn.close


    If the application crash before it reaches the objConn.close line, it will remain open.

    A good practice is to put error trapping in the code

    ASP - use 'On Error resume next' statement

    ASP.net use Try/Catch

    eg.

    Try

    objConn.open
    ' Do stuff here

    Catch
    ' Do whatever error trapping ehre

    Finally
    objConn.close
    End Try

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page