The Microsoft Jet database engine cannot open the file

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZQ==?=, Aug 3, 2005.

  1. This is my first .NET project (although I am experienced with VS6 and
    InterDev). I am simply trying to set up a basic ASPX project and connect to
    an Access database (following the instructions in the .NET Black Book by
    Templeman and Vitter). I have managed to set up an oleDbConnection, an
    oleDbAdapter and a dataset, and have added one line of code:
    oleDbDataAdapter1.Fill(dataSet1);
    However when this line of code executes I get whole page of error headed
    "The Microsoft Jet database engine cannot open the file 'C:\Documents and
    Settings\Dave\PAW Files\Databases\Friends\Friends.mdb'. It is already opened
    exclusively by another user, or you need permission to view its data."
    I am using Access 2000 SP3 and Windows XP SP2. There is no remote access,
    the web application is being served from C:\Inetpub\wwwroot by IIS5.1 (which
    I think was installed when I installed VS6/Visual Interdev).
    It's my very first attempt at .NET and I'm getting nowhere. Can somebody
    please help.
    --
    Dave
     
    =?Utf-8?B?RGF2ZQ==?=, Aug 3, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?RGF2ZQ==?=

    Paul Clement Guest

    On Wed, 3 Aug 2005 06:27:05 -0700, "Dave" <> wrote:

    ¤ This is my first .NET project (although I am experienced with VS6 and
    ¤ InterDev). I am simply trying to set up a basic ASPX project and connect to
    ¤ an Access database (following the instructions in the .NET Black Book by
    ¤ Templeman and Vitter). I have managed to set up an oleDbConnection, an
    ¤ oleDbAdapter and a dataset, and have added one line of code:
    ¤ oleDbDataAdapter1.Fill(dataSet1);
    ¤ However when this line of code executes I get whole page of error headed
    ¤ "The Microsoft Jet database engine cannot open the file 'C:\Documents and
    ¤ Settings\Dave\PAW Files\Databases\Friends\Friends.mdb'. It is already opened
    ¤ exclusively by another user, or you need permission to view its data."
    ¤ I am using Access 2000 SP3 and Windows XP SP2. There is no remote access,
    ¤ the web application is being served from C:\Inetpub\wwwroot by IIS5.1 (which
    ¤ I think was installed when I installed VS6/Visual Interdev).
    ¤ It's my very first attempt at .NET and I'm getting nowhere. Can somebody
    ¤ please help.

    See the following MS KB article:

    PRB: Cannot connect to Access database from ASP.NET
    http://support.microsoft.com/default.aspx?scid=kb;en-us;316675


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Aug 3, 2005
    #2
    1. Advertising

  3. Thanks Paul. That's one I hadn't found.

    I have now enabled impersonation on my project. However, I now have a bigger
    problem - the same line of code now generates "Unspecified error: An
    unhandled exception occurred during the execution of the current web request."

    Any ideas?
    --
    Dave


    "Paul Clement" wrote:

    > On Wed, 3 Aug 2005 06:27:05 -0700, "Dave" <> wrote:
    >
    > ¤ This is my first .NET project (although I am experienced with VS6 and
    > ¤ InterDev). I am simply trying to set up a basic ASPX project and connect to
    > ¤ an Access database (following the instructions in the .NET Black Book by
    > ¤ Templeman and Vitter). I have managed to set up an oleDbConnection, an
    > ¤ oleDbAdapter and a dataset, and have added one line of code:
    > ¤ oleDbDataAdapter1.Fill(dataSet1);
    > ¤ However when this line of code executes I get whole page of error headed
    > ¤ "The Microsoft Jet database engine cannot open the file 'C:\Documents and
    > ¤ Settings\Dave\PAW Files\Databases\Friends\Friends.mdb'. It is already opened
    > ¤ exclusively by another user, or you need permission to view its data."
    > ¤ I am using Access 2000 SP3 and Windows XP SP2. There is no remote access,
    > ¤ the web application is being served from C:\Inetpub\wwwroot by IIS5.1 (which
    > ¤ I think was installed when I installed VS6/Visual Interdev).
    > ¤ It's my very first attempt at .NET and I'm getting nowhere. Can somebody
    > ¤ please help.
    >
    > See the following MS KB article:
    >
    > PRB: Cannot connect to Access database from ASP.NET
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;316675
    >
    >
    > Paul
    > ~~~~
    > Microsoft MVP (Visual Basic)
    >
     
    =?Utf-8?B?RGF2ZQ==?=, Aug 3, 2005
    #3
  4. =?Utf-8?B?RGF2ZQ==?=

    Paul Clement Guest

    On Wed, 3 Aug 2005 08:49:41 -0700, "Dave" <> wrote:

    ¤ Thanks Paul. That's one I hadn't found.
    ¤
    ¤ I have now enabled impersonation on my project. However, I now have a bigger
    ¤ problem - the same line of code now generates "Unspecified error: An
    ¤ unhandled exception occurred during the execution of the current web request."
    ¤
    ¤ Any ideas?

    Sounds like there is still a security issue although the error isn't very descriptive. What level of
    authentication are you using? If it's Anonymous and impersonation is enabled, then you probably need
    to provide full permissions for the folder where the Access database is located to IUSR<machinename>
    account.


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Aug 4, 2005
    #4
  5. I am using anonymous authentication I think. I am reading a lot of stuff and
    getting very confused. Is it the IUSR_<machinename> user I need to grant
    permissions to, or is it ASPNET?
    I think one of my problems is that my system uses something called
    "guest-only" security instead of "classic" security. Does that make sense? I
    think I need to change that first.
    --
    Dave


    "Paul Clement" wrote:

    > On Wed, 3 Aug 2005 08:49:41 -0700, "Dave" <> wrote:
    >
    > ¤ Thanks Paul. That's one I hadn't found.
    > ¤
    > ¤ I have now enabled impersonation on my project. However, I now have a bigger
    > ¤ problem - the same line of code now generates "Unspecified error: An
    > ¤ unhandled exception occurred during the execution of the current web request."
    > ¤
    > ¤ Any ideas?
    >
    > Sounds like there is still a security issue although the error isn't very descriptive. What level of
    > authentication are you using? If it's Anonymous and impersonation is enabled, then you probably need
    > to provide full permissions for the folder where the Access database is located to IUSR<machinename>
    > account.
    >
    >
    > Paul
    > ~~~~
    > Microsoft MVP (Visual Basic)
    >
     
    =?Utf-8?B?RGF2ZQ==?=, Aug 4, 2005
    #5
  6. =?Utf-8?B?RGF2ZQ==?=

    Paul Clement Guest

    On Thu, 4 Aug 2005 09:04:08 -0700, "Dave" <> wrote:

    ¤ I am using anonymous authentication I think. I am reading a lot of stuff and
    ¤ getting very confused. Is it the IUSR_<machinename> user I need to grant
    ¤ permissions to, or is it ASPNET?
    ¤ I think one of my problems is that my system uses something called
    ¤ "guest-only" security instead of "classic" security. Does that make sense? I
    ¤ think I need to change that first.

    If impersonation is enabled with Anonymous access then the IUSR (or IWAM) account is used depending
    upon the Application Settings in IIS for the app. If impersonation is not enabled then the account
    used is ASPNET (NetworkService in Windows 2003).


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Aug 4, 2005
    #6
  7. Finally cracked it - I started off giving ASPNET rights to the .mdb file, but
    that didn't fully solve it, I got locking errors. Then I put 2 and 2 together
    (locking error - .ldb file) and gave ASPNET rights to the folder containing
    the database too, and that seems to have solved it.

    Thanks for your help
    --
    Dave


    "Paul Clement" wrote:

    > On Thu, 4 Aug 2005 09:04:08 -0700, "Dave" <> wrote:
    >
    > ¤ I am using anonymous authentication I think. I am reading a lot of stuff and
    > ¤ getting very confused. Is it the IUSR_<machinename> user I need to grant
    > ¤ permissions to, or is it ASPNET?
    > ¤ I think one of my problems is that my system uses something called
    > ¤ "guest-only" security instead of "classic" security. Does that make sense? I
    > ¤ think I need to change that first.
    >
    > If impersonation is enabled with Anonymous access then the IUSR (or IWAM) account is used depending
    > upon the Application Settings in IIS for the app. If impersonation is not enabled then the account
    > used is ASPNET (NetworkService in Windows 2003).
    >
    >
    > Paul
    > ~~~~
    > Microsoft MVP (Visual Basic)
    >
     
    =?Utf-8?B?RGF2ZQ==?=, Aug 5, 2005
    #7
    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. =?Utf-8?B?TmVhbA==?=
    Replies:
    3
    Views:
    41,654
    Paul Clement
    Sep 2, 2005
  2. Morten Wennevik
    Replies:
    1
    Views:
    3,122
    Morten Wennevik
    Oct 31, 2005
  3. mamin
    Replies:
    1
    Views:
    3,451
    elcon
    Jul 28, 2010
  4. Jas
    Replies:
    1
    Views:
    960
    Patrice
    Jan 25, 2010
  5. snazzy
    Replies:
    2
    Views:
    260
    Bob Barrows [MVP]
    Nov 7, 2008
Loading...

Share This Page