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

  • Thread starter Tom Kaminski [MVP]
  • 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)?
 
T

tropico

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.
 
T

Tom Kaminski [MVP]

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 ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top