Cannot open an access database from within an ASP.NET application

Discussion in 'ASP .Net' started by =?Utf-8?B?dnZlbms=?=, Oct 5, 2005.

  1. Hello:

    When I tried to use an Access database, I get the following exception:

    Server Error in '/WebGrid' Application
    --------------------------------------------------------------------------------

    The Microsoft Jet database engine cannot open the file 'D:\Program
    Files\Infragistics\NetAdvantage 2005 Volume
    2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    by another user, or you need permission to view its data.

    I made sure that the folder, Data, has full access to these two accouhts,
    <machine_name>\aspnet and <machine_Name>\IWAM_machine_name

    Can somebody tell me how I can resolve this issue? Thanks.

    Venki
     
    =?Utf-8?B?dnZlbms=?=, Oct 5, 2005
    #1
    1. Advertising

  2. 1)
    Is the database open?
    If you have the database open in Access, you will get this exception.
    So if you have the database open, close it and try again.

    2)
    If your sure you don't have the database open, check that its closed
    properly.
    When you open an Access database file for editing, it create a temp file
    called "samplebrowser.idb".
    When you close the database, that file disapears.
    If its still there, the database may have not closed properly, try closing
    it again

    3) Lastly

    Try setting persmissions to IUSR_<machine_name>,
    thats the user IIS uses.
    If you not sure, set full permissions to everyone just incase

    HTH

    "vvenk" <> wrote in message
    news:...
    > Hello:
    >
    > When I tried to use an Access database, I get the following exception:
    >
    > Server Error in '/WebGrid' Application.
    > --------------------------------------------------------------------------------
    >
    > The Microsoft Jet database engine cannot open the file 'D:\Program
    > Files\Infragistics\NetAdvantage 2005 Volume
    > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened
    > exclusively
    > by another user, or you need permission to view its data.
    >
    > I made sure that the folder, Data, has full access to these two accouhts,
    > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    >
    > Can somebody tell me how I can resolve this issue? Thanks.
    >
    > Venki
     
    Grant Merwitz, Oct 5, 2005
    #2
    1. Advertising

  3. Folder & File.
    Also, check your IIS settings, are you using anonymous or integrated
    security? That determins the user you need to set for permissions.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "vvenk" wrote:

    > Hello:
    >
    > When I tried to use an Access database, I get the following exception:
    >
    > Server Error in '/WebGrid' Application.
    > --------------------------------------------------------------------------------
    >
    > The Microsoft Jet database engine cannot open the file 'D:\Program
    > Files\Infragistics\NetAdvantage 2005 Volume
    > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    > by another user, or you need permission to view its data.
    >
    > I made sure that the folder, Data, has full access to these two accouhts,
    > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    >
    > Can somebody tell me how I can resolve this issue? Thanks.
    >
    > Venki
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Oct 5, 2005
    #3
  4. RE: Cannot open an access database from within an ASP.NET applicat

    Curt:

    In the website's security setting, Enable_Anonymous_Access is checked and
    the it uses the account IUSER_<machine_Name> for access. And, I made sure
    that this account has full access rights.

    Also, Integrated Windows Authentication is checked as well.

    Venki

    "Curt_C [MVP]" wrote:

    > Folder & File.
    > Also, check your IIS settings, are you using anonymous or integrated
    > security? That determins the user you need to set for permissions.
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    >
    >
    >
    > "vvenk" wrote:
    >
    > > Hello:
    > >
    > > When I tried to use an Access database, I get the following exception:
    > >
    > > Server Error in '/WebGrid' Application.
    > > --------------------------------------------------------------------------------
    > >
    > > The Microsoft Jet database engine cannot open the file 'D:\Program
    > > Files\Infragistics\NetAdvantage 2005 Volume
    > > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    > > by another user, or you need permission to view its data.
    > >
    > > I made sure that the folder, Data, has full access to these two accouhts,
    > > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    > >
    > > Can somebody tell me how I can resolve this issue? Thanks.
    > >
    > > Venki
     
    =?Utf-8?B?dnZlbms=?=, Oct 5, 2005
    #4
  5. I never meant just in case --> " If you not sure, set full permissions to
    everyone just incase"

    I meant Just to TEST

    "Grant Merwitz" <> wrote in message
    news:...
    > 1)
    > Is the database open?
    > If you have the database open in Access, you will get this exception.
    > So if you have the database open, close it and try again.
    >
    > 2)
    > If your sure you don't have the database open, check that its closed
    > properly.
    > When you open an Access database file for editing, it create a temp file
    > called "samplebrowser.idb".
    > When you close the database, that file disapears.
    > If its still there, the database may have not closed properly, try closing
    > it again
    >
    > 3) Lastly
    >
    > Try setting persmissions to IUSR_<machine_name>,
    > thats the user IIS uses.
    > If you not sure, set full permissions to everyone just incase
    >
    > HTH
    >
    > "vvenk" <> wrote in message
    > news:...
    >> Hello:
    >>
    >> When I tried to use an Access database, I get the following exception:
    >>
    >> Server Error in '/WebGrid' Application.
    >> --------------------------------------------------------------------------------
    >>
    >> The Microsoft Jet database engine cannot open the file 'D:\Program
    >> Files\Infragistics\NetAdvantage 2005 Volume
    >> 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened
    >> exclusively
    >> by another user, or you need permission to view its data.
    >>
    >> I made sure that the folder, Data, has full access to these two accouhts,
    >> <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    >>
    >> Can somebody tell me how I can resolve this issue? Thanks.
    >>
    >> Venki

    >
    >
     
    Grant Merwitz, Oct 5, 2005
    #5
  6. Re: Cannot open an access database from within an ASP.NET applicat

    Grant:

    When I gave the account, Everybody, Full Control, it worked. Now, I have to
    figure out who really needs that level of access.

    Thanks.

    "Grant Merwitz" wrote:

    > 1)
    > Is the database open?
    > If you have the database open in Access, you will get this exception.
    > So if you have the database open, close it and try again.
    >
    > 2)
    > If your sure you don't have the database open, check that its closed
    > properly.
    > When you open an Access database file for editing, it create a temp file
    > called "samplebrowser.idb".
    > When you close the database, that file disapears.
    > If its still there, the database may have not closed properly, try closing
    > it again
    >
    > 3) Lastly
    >
    > Try setting persmissions to IUSR_<machine_name>,
    > thats the user IIS uses.
    > If you not sure, set full permissions to everyone just incase
    >
    > HTH
    >
    > "vvenk" <> wrote in message
    > news:...
    > > Hello:
    > >
    > > When I tried to use an Access database, I get the following exception:
    > >
    > > Server Error in '/WebGrid' Application.
    > > --------------------------------------------------------------------------------
    > >
    > > The Microsoft Jet database engine cannot open the file 'D:\Program
    > > Files\Infragistics\NetAdvantage 2005 Volume
    > > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened
    > > exclusively
    > > by another user, or you need permission to view its data.
    > >
    > > I made sure that the folder, Data, has full access to these two accouhts,
    > > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    > >
    > > Can somebody tell me how I can resolve this issue? Thanks.
    > >
    > > Venki

    >
    >
    >
     
    =?Utf-8?B?dnZlbms=?=, Oct 5, 2005
    #6
  7. Re: Cannot open an access database from within an ASP.NET applicat

    To find out which account needs access permission,
    save the following as identity.aspx and run it.

    identity.aspx
    -------------------
    <%@ Page Language="VB" %>
    <%@ Import NameSpace = System.Security.Principal %>
    <script runat="server">
    Sub Page_Load()
    Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    Label1.Text = tmp
    End Sub
    </script>
    <html>
    <head>
    <title>WindowsIdentity.GetCurrent.Name()</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    </div>
    </form>
    </body>
    </html>
    ------------------

    When you run that file, it will return the current ASP.NET identity,
    i.e., the account ASP.NET is running as.

    Give *that* account the access permissions to the directory and file.




    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "vvenk" <> wrote in message
    news:...
    > Curt:
    >
    > In the website's security setting, Enable_Anonymous_Access is checked and
    > the it uses the account IUSER_<machine_Name> for access. And, I made sure
    > that this account has full access rights.
    >
    > Also, Integrated Windows Authentication is checked as well.
    >
    > Venki
    >
    > "Curt_C [MVP]" wrote:
    >
    >> Folder & File.
    >> Also, check your IIS settings, are you using anonymous or integrated
    >> security? That determins the user you need to set for permissions.
    >>
    >> --
    >> Curt Christianson
    >> site: http://www.darkfalz.com
    >> blog: http://blog.darkfalz.com
    >>
    >>
    >>
    >> "vvenk" wrote:
    >>
    >> > Hello:
    >> >
    >> > When I tried to use an Access database, I get the following exception:
    >> >
    >> > Server Error in '/WebGrid' Application.
    >> > --------------------------------------------------------------------------------
    >> >
    >> > The Microsoft Jet database engine cannot open the file 'D:\Program
    >> > Files\Infragistics\NetAdvantage 2005 Volume
    >> > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    >> > by another user, or you need permission to view its data.
    >> >
    >> > I made sure that the folder, Data, has full access to these two accouhts,
    >> > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    >> >
    >> > Can somebody tell me how I can resolve this issue? Thanks.
    >> >
    >> > Venki
     
    Juan T. Llibre, Oct 5, 2005
    #7
  8. Re: Cannot open an access database from within an ASP.NET applicat

    Juan:

    Thank you so much for thsi jewel. I came to know that Network Services needs
    to have full control on this folder.

    Venki

    "Juan T. Llibre" wrote:

    > To find out which account needs access permission,
    > save the following as identity.aspx and run it.
    >
    > identity.aspx
    > -------------------
    > <%@ Page Language="VB" %>
    > <%@ Import NameSpace = System.Security.Principal %>
    > <script runat="server">
    > Sub Page_Load()
    > Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    > Label1.Text = tmp
    > End Sub
    > </script>
    > <html>
    > <head>
    > <title>WindowsIdentity.GetCurrent.Name()</title>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    > </div>
    > </form>
    > </body>
    > </html>
    > ------------------
    >
    > When you run that file, it will return the current ASP.NET identity,
    > i.e., the account ASP.NET is running as.
    >
    > Give *that* account the access permissions to the directory and file.
    >
    >
    >
    >
    > Juan T. Llibre, ASP.NET MVP
    > ASP.NET FAQ : http://asp.net.do/faq/
    > Foros de ASP.NET en Español : http://asp.net.do/foros/
    > ======================================
    > "vvenk" <> wrote in message
    > news:...
    > > Curt:
    > >
    > > In the website's security setting, Enable_Anonymous_Access is checked and
    > > the it uses the account IUSER_<machine_Name> for access. And, I made sure
    > > that this account has full access rights.
    > >
    > > Also, Integrated Windows Authentication is checked as well.
    > >
    > > Venki
    > >
    > > "Curt_C [MVP]" wrote:
    > >
    > >> Folder & File.
    > >> Also, check your IIS settings, are you using anonymous or integrated
    > >> security? That determins the user you need to set for permissions.
    > >>
    > >> --
    > >> Curt Christianson
    > >> site: http://www.darkfalz.com
    > >> blog: http://blog.darkfalz.com
    > >>
    > >>
    > >>
    > >> "vvenk" wrote:
    > >>
    > >> > Hello:
    > >> >
    > >> > When I tried to use an Access database, I get the following exception:
    > >> >
    > >> > Server Error in '/WebGrid' Application.
    > >> > --------------------------------------------------------------------------------
    > >> >
    > >> > The Microsoft Jet database engine cannot open the file 'D:\Program
    > >> > Files\Infragistics\NetAdvantage 2005 Volume
    > >> > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    > >> > by another user, or you need permission to view its data.
    > >> >
    > >> > I made sure that the folder, Data, has full access to these two accouhts,
    > >> > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    > >> >
    > >> > Can somebody tell me how I can resolve this issue? Thanks.
    > >> >
    > >> > Venki

    >
    >
    >
     
    =?Utf-8?B?dnZlbms=?=, Oct 5, 2005
    #8
  9. Re: Cannot open an access database from within an ASP.NET applicat

    re:
    > Thank you so much for this jewel.


    You're very much welcome, wenk.

    I wrote that script, in desperation, after butting my head against
    the wall for hours with exactly the same problem you were having.

    It sure makes configuring ASP.NET permissions easier, doesn't it ?

    ;-)



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "vvenk" <> wrote in message
    news:...
    > Juan:
    >
    > Thank you so much for thsi jewel. I came to know that Network Services needs
    > to have full control on this folder.
    >
    > Venki
    >
    > "Juan T. Llibre" wrote:
    >
    >> To find out which account needs access permission,
    >> save the following as identity.aspx and run it.
    >>
    >> identity.aspx
    >> -------------------
    >> <%@ Page Language="VB" %>
    >> <%@ Import NameSpace = System.Security.Principal %>
    >> <script runat="server">
    >> Sub Page_Load()
    >> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    >> Label1.Text = tmp
    >> End Sub
    >> </script>
    >> <html>
    >> <head>
    >> <title>WindowsIdentity.GetCurrent.Name()</title>
    >> </head>
    >> <body>
    >> <form id="form1" runat="server">
    >> <div>
    >> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    >> </div>
    >> </form>
    >> </body>
    >> </html>
    >> ------------------
    >>
    >> When you run that file, it will return the current ASP.NET identity,
    >> i.e., the account ASP.NET is running as.
    >>
    >> Give *that* account the access permissions to the directory and file.
    >>
    >>
    >> Juan T. Llibre, ASP.NET MVP
    >> ASP.NET FAQ : http://asp.net.do/faq/
    >> Foros de ASP.NET en Español : http://asp.net.do/foros/
    >> ======================================
    >> "vvenk" <> wrote in message
    >> news:...
    >> > Curt:
    >> >
    >> > In the website's security setting, Enable_Anonymous_Access is checked and
    >> > the it uses the account IUSER_<machine_Name> for access. And, I made sure
    >> > that this account has full access rights.
    >> >
    >> > Also, Integrated Windows Authentication is checked as well.
    >> >
    >> > Venki
    >> >
    >> > "Curt_C [MVP]" wrote:
    >> >
    >> >> Folder & File.
    >> >> Also, check your IIS settings, are you using anonymous or integrated
    >> >> security? That determins the user you need to set for permissions.
    >> >> --
    >> >> Curt Christianson
    >> >> site: http://www.darkfalz.com
    >> >> blog: http://blog.darkfalz.com
    >> >>
    >> >>
    >> >>
    >> >> "vvenk" wrote:
    >> >>
    >> >> > Hello:
    >> >> >
    >> >> > When I tried to use an Access database, I get the following exception:
    >> >> >
    >> >> > Server Error in '/WebGrid' Application.
    >> >> > --------------------------------------------------------------------------------
    >> >> >
    >> >> > The Microsoft Jet database engine cannot open the file 'D:\Program
    >> >> > Files\Infragistics\NetAdvantage 2005 Volume
    >> >> > 2\ASP.NET\Samples\Data\samplebrowser.mdb'. It is already opened exclusively
    >> >> > by another user, or you need permission to view its data.
    >> >> >
    >> >> > I made sure that the folder, Data, has full access to these two accouhts,
    >> >> > <machine_name>\aspnet and <machine_Name>\IWAM_machine_name
    >> >> >
    >> >> > Can somebody tell me how I can resolve this issue? Thanks.
    >> >> >
    >> >> > Venki
     
    Juan T. Llibre, Oct 5, 2005
    #9
  10. =?Utf-8?B?dnZlbms=?=

    Sabine Guest

    Re: Cannot open an access database from within an ASP.NET applicat

    Juan,

    This aspx file is marvelous, it helped me a lot. Thank you very much.

    Sabine
     
    Sabine, Oct 19, 2005
    #10
  11. Re: Cannot open an access database from within an ASP.NET applicat

    You're very much welcome, Sabine.

    Feel free to pass it along to anybody who needs it.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Sabine" <> wrote in message
    news:...
    > Juan,
    >
    > This aspx file is marvelous, it helped me a lot. Thank you very much.
    >
    > Sabine
     
    Juan T. Llibre, Oct 19, 2005
    #11
    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. James N
    Replies:
    3
    Views:
    5,347
    James N
    Jul 18, 2003
  2. THY
    Replies:
    4
    Views:
    534
    Gönen EREN
    Aug 22, 2003
  3. Vyacheslav Lanovets
    Replies:
    2
    Views:
    3,147
    Juan T. Llibre
    Jul 27, 2005
  4. =?Utf-8?B?YWJoaXNoZWs=?=

    Cannot open my asp.net application in vs.net

    =?Utf-8?B?YWJoaXNoZWs=?=, Aug 31, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    2,570
    Scott M.
    Sep 1, 2006
  5. xg
    Replies:
    5
    Views:
    185
    Bob Barrows [MVP]
    Mar 20, 2006
Loading...

Share This Page