Connection to SQL fails, OK from ASP and VS.NET

  • Thread starter Thread starter Tom Kaminski [MVP]
  • Start date Start date
T

Tom Kaminski [MVP]

My SQLConnection fails from an aspx using Basic authentication and an
integrated authentication connection string. An ASP in the same folder
works 100% OK and I am also able to connect to and work with the database
using my Windows account through Visual Studio 2003 as well as SQL
Enterprise Manager - so it seems as though permissions are configured
correctly on the DB.

Here's my error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

Here's my connection string:
data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
Security=True;workstation id=ASP_NET

What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
Server (when an ASP in the same folder with the same connection string is)?
 
On Thu, 06 Nov 2003 08:51:05 -0500, Tom Kaminski [MVP] wrote:
Your mixing 2 things here. The user who access the web site and the user
used by your application.

If your using Trusted_Connection you have to allow the user
MACHINENAME\ASPNET on your database. Your application is running under
this user by default.

If your working with Windows 2003 is the user NT AUTHORITY\NETWORK
SERVICE wich is used.

The other possibnility is to specified "user id" and "password" in
connection string.
 
Tom Kaminski said:
My SQLConnection fails from an aspx using Basic authentication and an
integrated authentication connection string. An ASP in the same folder
works 100% OK and I am also able to connect to and work with the database
using my Windows account through Visual Studio 2003 as well as SQL
Enterprise Manager - so it seems as though permissions are configured
correctly on the DB.

Here's my error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

Here's my connection string:
data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
Security=True;workstation id=ASP_NET

What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
Server (when an ASP in the same folder with the same connection string
is)?

Never mind ...

I had to add:
<identity impersonate="true"/>

To my web.config file under the <system.web> section.

I found my answer after searching this group through google ...
 
Back
Top