Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP.NET, ADODB and "Access Denied"

ASP.Confused
Guest
 
Posts: n/a
#1: Nov 18 '05
The old message looked a little stale, so I am re-posting it here. Anybody
have any ideas of what I could do?!? The previous responses to this
question are below. If you want to look at the original question, the
subject line is:

ADODB.NET and "Access Denied"



I have an ASP.NET page writtein in VB that uses ADODB. I just had to
force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses
this, and I wanted to be compatible with them.) I had to manually install
all of the ODBC drivers and the rest of the DLL's, and now I am getting
"Access is Denied" errors on any page that uses ADODB.

How do I fix it? I already gave the ODBC drivers in the folders in
"c:\program files\common files\system\" full access rights for both IUSR
accounts and the ASPNET account.




Here is the output of the error:

Access is denied.
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.UnauthorizedAccessException: Access is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.

Source Error:

Line 1: <script language="VB" runat="server">
*** Line 2: dim oConn as ADODB.Connection = new ADODB.Connection()
Line 3: </script>
Line 4: <%










"ASP.Confused" <anonymous@> wrote in message
news:%23WR%232SOSEHA.1348@TK2MSFTNGP12.phx.gbl...[color=blue]
> Well, I have the exact same script running on 3 other servers, so I know[/color]
the[color=blue]
> script is working. I meant that I didn't want to take the time to create[/color]
a[color=blue]
> dataset within Visual Studio.NET's interface (since my SQL tables are not
> owned by "dbo", and it's a pain to create them if the table is not owned[/color]
by[color=blue]
> "dbo".)
>
> I'm thinking that when I had to force install MDAC 2.8, it did not set[/color]
file[color=blue]
> permissions properly. I went in to set all of the ODBC drivers to have[/color]
full[color=blue]
> access by ASPNET, IUSR and IWAM accounts, but that did not fix it yet.
>
> Do you know what might need to be set to get this to work, or do you know
> how I could force install MDAC through the setup program (I originally had
> to do it file by file.)
>
>
>
>
> "Raterus" <raterus@spam.org> wrote in message
> news:O4L0RNOSEHA.3840@TK2MSFTNGP09.phx.gbl...
> I apologize too, I know I'm not answering your original question, I just
> think your access problems will go away if you use ADO.NET :-)
>
> "ASP.Confused" <anonymous@> wrote in message
> news:uP%23kjBOSEHA.1764@TK2MSFTNGP10.phx.gbl...[color=green]
> > I'm using ADO because I just need to do a simple login script, and[/color][/color]
taking[color=blue][color=green]
> > time to set up a dataset to do such a trivial task would be pointless.
> > Plus, we are in the process of migrating our ASP 3.0 web pages over to
> > ASP.NET, and this eases the transition.
> >
> > I just noticed something about 5 minutes ago. If I go to an ASP page on[/color]
> my[color=green]
> > development computer (the one that is having all the issues with "Access
> > Denied", it works. But if I use an ASP.NET page using ADO, it gives me[/color]
> the[color=green]
> > error.
> >
> > "Raterus" <raterus@spam.org> wrote in message
> > news:uCiR04NSEHA.3944@TK2MSFTNGP11.phx.gbl...
> > Any reason you using ADO and not ADO.NET?
> >
> > "ASP.Confused" <anonymous@> wrote in message
> > news:uxeCSzNSEHA.1312@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > I have an ASP.NET page writtein in VB that uses ADODB. I just had to
> > > force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host[/color][/color]
> uses[color=green][color=darkred]
> > > this, and I wanted to be compatible with them.) I had to manually[/color][/color]
> install[color=green][color=darkred]
> > > all of the ODBC drivers and the rest of the DLL's, and now I am[/color][/color][/color]
getting[color=blue][color=green][color=darkred]
> > > "Access is Denied" errors on any page that uses ADODB.
> > >
> > > How do I fix it? I already gave the ODBC drivers in the folders in
> > > "c:\program files\common files\system\" full access rights for both[/color][/color][/color]
IUSR[color=blue][color=green][color=darkred]
> > > accounts and the ASPNET account.
> > >
> > >
> > > Here is the output of the error:
> > >
> > > Access is denied.
> > > Description: An unhandled exception occurred during the execution of[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > current web request. Please review the stack trace for more[/color][/color][/color]
information[color=blue][color=green][color=darkred]
> > > about the error and where it originated in the code.
> > >
> > > Exception Details: System.UnauthorizedAccessException: Access is[/color][/color][/color]
denied.[color=blue][color=green][color=darkred]
> > >
> > > ASP.NET is not authorized to access the requested resource. Consider
> > > granting access rights to the resource to the ASP.NET request[/color][/color][/color]
identity.[color=blue][color=green][color=darkred]
> > > ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS[/color][/color][/color]
5[color=blue][color=green]
> > or[color=darkred]
> > > Network Service on IIS 6) that is used if the application is not
> > > impersonating. If the application is impersonating via <identity
> > > impersonate="true"/>, the identity will be the anonymous user[/color][/color][/color]
(typically[color=blue][color=green][color=darkred]
> > > IUSR_MACHINENAME) or the authenticated request user.
> > >
> > > To grant ASP.NET write access to a file, right-click the file in[/color][/color]
> Explorer,[color=green][color=darkred]
> > > choose "Properties" and select the Security tab. Click "Add" to add[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > appropriate user or group. Highlight the ASP.NET account, and check[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > boxes for the desired access.
> > >
> > > Source Error:
> > >
> > > Line 1: <script language="VB" runat="server">
> > > *** Line 2: dim oConn as ADODB.Connection = new ADODB.Connection()
> > > Line 3: </script>
> > > Line 4: <%
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]



Closed Thread


Similar ASP.NET bytes