Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

User Controls and database connection under SPS 2003

  Asked By: Mitchell    Date: Sep 23    Category: Sharepoint    Views: 1070

We have an ascx User Control that makes sqlclient database
connection to SQL-Server 2000. This user control is then contained
on asp.net page for testing (we eventually want
To use control in a web part).

This control functions normally if it resides in an IIS 6.0 web site
not configured for SharePoint 2003.

However if this is run under an IIS 6.0 web site configured for
SharePoint 2003 I get the following error when trying to connect:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

Please note that the folder with the asp.net test application is
part of SharePoint's exclude path. Also this test application will
run correctly if referenced thru browser on the portal server
itself. I'ts only when referencing portal from another client that
error occurs.

Is there something in SharePoints config file that is causing this
behavior?

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Tanner Moss     Answered On: Sep 23

In IIS look at Web Service Extension and Allow ASP.NET v1.1.4322

 
Answer #2    Answered By: Bobby Boyd     Answered On: Sep 23

I verified that IIS is allowing asp.net v1.1.
Problem still occurs.

 
Answer #3    Answered By: Sean Perez     Answered On: Sep 23

When a control runs under an excluded path, it will run under an
Application Pool, if you didn't change the application pool for
Sharepoint it will run underr the NETWORK Service account. In order to
fix your problem you need to either
- Change the application pool for the virtual directory
- Check the Identity of the pool configured for your virtual directory
and make sure this user  has been granted access to the SQL database.

I will recommend using a Windows/AD Account and grant this user access
to SQL and the database

 
Answer #4    Answered By: Moises Harrington     Answered On: Sep 23

Tried what you suggested but behavior is the same. The pool is
using a Windows AD account with db access. It appears that IIS
isn't passing the pool ID on to the database  server for some reason.

 
Answer #5    Answered By: Kory Brock     Answered On: Sep 23

Make sure the virtual directory has Anonymous disabled too

 
Answer #6    Answered By: Ernesto Dawson     Answered On: Sep 23

Verified that anonymous access disabled on the virtual directory.

 
Didn't find what you were looking for? Find more on User Controls and database connection under SPS 2003 Or get search suggestion and latest updates.




Tagged: