2008 IIS7 connection to SQL Server 2000 on Web Server 2000: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I am setting up a windows 2008 IIS7 web server, and trying to connect to a windows 2000 sql server 2000 database. I have an IIS6 Windows 2000 web server activately connected just fine.

I have anonymous and windows authentication enabled. And in my web.config I have identity impersonate="true"

My sql server 2000 typically uses the IISUSER anonymous user set up in IIS6 on my original windows 2000 web server. But this new IIS7 is giving me grief. I can't seem to setup the IUSR or IISUSER or anything in it. I can't even use sql server credentials in my connection string although my SQL Server supports both. I get: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. If I use credentials, which work on my windows 2000 IIS6, it fails in IIS7/2008.

On my windows 2008 box, I can setup an ODBC connection in the control panel and test it just fine, so I know I'm getting to the database server and test fine. It's just in IIS7 that it won't give me a break.

I have tried connecting via my remote IP address and my local IP address. Neither work, although both work with my other web server and my other websites.

I have scoured the web and everything trying to find a solution. Can you please help with any advice?



10/17/2008 11:54:25 PM
📁 asp.net.sql-datasource
📃 29906 articles.

💬 2 Replies

Hi Nannette,

This exception can be caused by a couple of reasons.

Sometimes, the application is running with anonymous access. However, there is "Integrated
Security=SSPI" in the connection string which means the identity of the user who is accessing the website should be passed to SQL Server to establish connection, but since the logged in
identity is anonymous, no user account was passed to SQL Server.

In addition, you may refer to the links below:



Jian Kang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
10/21/2008 7:03:44 AM

In step#5 below, I finally got it to work by using the SQL Server Authentication.

My config file connection string still uses Windows authentication, however.

(i)Add the Windows account to SQL Server:


Start Enterprise Manager.
2. Expand Microsoft SQL Server, and then expand SQL Server Group.
3. Expand your server, and then expand Security.
4. Right-click Logins, and then click New Login.
5. In the SQL Server Login Properties dialog box, enter the Windows account name in the Name box. In the Domain list, select the domain that the Windows account is a member of.
6. Click the Database Access tab, set the appropriate permissions for the client, and then click OK.
10/22/2008 5:21:49 AM