ASP.NET webforms cannot exec stored procs

  • Thread starter Thread starter Paul R
  • Start date Start date
P

Paul R

Hi,

I have a Winforms application that access some SQLServer2000 stored
procedures.

I have now written some new Webforms pages to use some of the same stored
procs. The Webforms use the SAME data access classes (all of my business
logic and data access classes are in DLLs that are shared between the
Winforms and Webforms).

The Winforms are all ok, but the Webforms give me the following error when I
try to access the database through stored procs:

Execute access is denied to stored procedure "GetParts" in database
"Lcc" for owner "dbo"

The WinForms and WebForms all use the same db connection string:
<add key="connection_string" value="Server=(local);Database=lcc;Integrated
Security=True"/>

I guess it is an access rights problem, but what is the best way to resolve
it?

Do the Webforms connect as a different user?

Thanks,

Paul
 
Paul said:
Execute access is denied to stored procedure "GetParts" in database
"Lcc" for owner "dbo"

The WinForms and WebForms all use the same db connection string:
<add key="connection_string" value="Server=(local);Database=lcc;Integrated
Security=True"/>

I guess it is an access rights problem, but what is the best way to
resolve it?

Do the Webforms connect as a different user?

Though it depends on the setup of the web server and ASP.NET, the ASP.NET
code usually runs under a dedicated ASP.NET user. So you can either give
that user access to the stored procedures or you can change the setup of
the web server and ASP.NET, so that the ASP.NET code impersonates the
user who is sitting behind the web browser. Disable Anonymous access for the
folder/page in IIS and enable impersonation in web.config to do so.
 
Back
Top