Access database won't open

Discussion in 'ASP .Net' started by Frank Hayward, Nov 23, 2004.

  1. Hello.

    I have created a database connection to an access database in my web
    application. The problem is that I get the following error message, even
    though nobody is connected to the database. I have tried a fresh boot,
    downloading the latest Jet drivers, disabling the sql server, and moving the
    database from c:\inetpub\wwwroot\web... to a spot on my hardrive, but none
    of these has worked. I am following an exercise from a book so there is no
    chance that I have made a coding error. I have also checked all permissions
    and doubt that is the problem.

    Please help

    Thanks Frank
    Server Error in '/web/DataWebTrial' Application.
    ----------------------------------------------------------------------------
    ----

    The Microsoft Jet database engine cannot open the file 'E:\Documents and
    Settings\Frank\My Documents\Visual Studio Projects\DataWebTrial\Data.mdb'.
    It is already opened exclusively by another user, or you need permission to
    view its data.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet
    database engine cannot open the file 'E:\Documents and Settings\Frank\My
    Documents\Visual Studio Projects\DataWebTrial\Data.mdb'. It is already
    opened exclusively by another user, or you need permission to view its data.

    Source Error:


    Line 116: Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles btnLoad.Click
    Line 117: DsEmployee1.Clear()
    Line 118: OleDbDataAdapter1.Fill(DsEmployee1)
    Line 119: End Sub
    Line 120:



    Source File: c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb Line:
    118

    Stack Trace:


    [OleDbException (0x80004005): The Microsoft Jet database engine cannot open
    the file 'E:\Documents and Settings\Frank\My Documents\Visual Studio
    Projects\DataWebTrial\Data.mdb'. It is already opened exclusively by
    another user, or you need permission to view its data.]
    System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
    System.Data.OleDb.OleDbConnection.InitializeProvider()
    System.Data.OleDb.OleDbConnection.Open()
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    ConnectionState& originalState)
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    DataWebTrial.WebForm1.btnLoad_Click(Object sender, EventArgs e) in
    c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb:118
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)

    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
    stBackEvent(String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    System.Web.UI.Page.ProcessRequestMain()






    ----------------------------------------------------------------------------
    ----

    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
    Version:1.1.4322.573
    Frank Hayward, Nov 23, 2004
    #1
    1. Advertising

  2. Frank Hayward

    Mary Chipman Guest

    When you attempt to connect to an Access mdb from asp.net, you are not
    connecting with *your* permissions on the file system, but with those
    of the ASP.NET Machine Account (ASPNET). This is a restricted account
    and is determined by the <processModel> section in the Machine.config
    file. It affects all ASP.NET applications running on the server by
    sandboxing them so that they do not have administrative file access on
    the host box. Grant the necessary ACLs to ASPNET on the folders
    containing the mdb and mdw files (read, write, delete so the .ldb
    files get cleaned up).

    --Mary

    On Tue, 23 Nov 2004 20:34:50 -0000, "Frank Hayward"
    <> wrote:

    >Hello.
    >
    >I have created a database connection to an access database in my web
    >application. The problem is that I get the following error message, even
    >though nobody is connected to the database. I have tried a fresh boot,
    >downloading the latest Jet drivers, disabling the sql server, and moving the
    >database from c:\inetpub\wwwroot\web... to a spot on my hardrive, but none
    >of these has worked. I am following an exercise from a book so there is no
    >chance that I have made a coding error. I have also checked all permissions
    >and doubt that is the problem.
    >
    >Please help
    >
    >Thanks Frank
    >Server Error in '/web/DataWebTrial' Application.
    >----------------------------------------------------------------------------
    >----
    >
    >The Microsoft Jet database engine cannot open the file 'E:\Documents and
    >Settings\Frank\My Documents\Visual Studio Projects\DataWebTrial\Data.mdb'.
    >It is already opened exclusively by another user, or you need permission to
    >view its data.
    >Description: An unhandled exception occurred during the execution of the
    >current web request. Please review the stack trace for more information
    >about the error and where it originated in the code.
    >
    >Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet
    >database engine cannot open the file 'E:\Documents and Settings\Frank\My
    >Documents\Visual Studio Projects\DataWebTrial\Data.mdb'. It is already
    >opened exclusively by another user, or you need permission to view its data.
    >
    >Source Error:
    >
    >
    >Line 116: Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal
    >e As System.EventArgs) Handles btnLoad.Click
    >Line 117: DsEmployee1.Clear()
    >Line 118: OleDbDataAdapter1.Fill(DsEmployee1)
    >Line 119: End Sub
    >Line 120:
    >
    >
    >
    >Source File: c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb Line:
    >118
    >
    >Stack Trace:
    >
    >
    >[OleDbException (0x80004005): The Microsoft Jet database engine cannot open
    >the file 'E:\Documents and Settings\Frank\My Documents\Visual Studio
    >Projects\DataWebTrial\Data.mdb'. It is already opened exclusively by
    >another user, or you need permission to view its data.]
    > System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
    > System.Data.OleDb.OleDbConnection.InitializeProvider()
    > System.Data.OleDb.OleDbConnection.Open()
    > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >ConnectionState& originalState)
    > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >CommandBehavior behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
    >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    >behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    > DataWebTrial.WebForm1.btnLoad_Click(Object sender, EventArgs e) in
    >c:\inetpub\wwwroot\web\DataWebTrial\WebForm1.aspx.vb:118
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    >
    >System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
    >stBackEvent(String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    >sourceControl, String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    > System.Web.UI.Page.ProcessRequestMain()
    >
    >
    >
    >
    >
    >
    >----------------------------------------------------------------------------
    >----
    >
    >Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
    >Version:1.1.4322.573
    >
    Mary Chipman, Nov 25, 2004
    #2
    1. Advertising

  3. Frank Hayward

    CodeDevil Guest

    I met a problem like that once.

    Try closing access and then try to connect to it from your code. If
    that doesn't work email me.


    got a code problem? hand it to the devil.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    CodeDevil, Dec 5, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    4
    Views:
    511
    Gönen EREN
    Aug 22, 2003
  2. Chad
    Replies:
    4
    Views:
    8,324
  3. =?Utf-8?B?dnZlbms=?=
    Replies:
    10
    Views:
    1,726
    Juan T. Llibre
    Oct 19, 2005
  4. damezumari
    Replies:
    0
    Views:
    582
    damezumari
    Mar 27, 2006
  5. Tony Johansson
    Replies:
    7
    Views:
    498
    Gregory A. Beamer
    Dec 23, 2009
Loading...

Share This Page