1

Here is the scenario:

IIS 6 and SQL Server 2005 on same machine:

I have just created a new application inside of my main website in IIS.

The root website has its own database. The application I just created under the root site has its own database, as well.

ASP.net pages in the root site connect to their database using trusted security. This web site is running in the default app pool which uses Windows' Network Service account.

The new application I just created is using that same app pool.

I added the network service account to the new application's database's users and granted db_owner, just like the root site's db is set up. When I try to run my new application I get this error:

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

When I switch the new app's connection string to use the sql server sa account, it works. I do not want to use the SA account.

I cannot figure this out! Please help.

3 Answers 3

3

By default IIS will try to use an ASPNET account which needs to be granted access to SQL Server. I don't have a setup anymore to describe this but the following link offers a couple of solutions:

bytes.com/groups/net-asp/290050-setting-up-integrated-security-sql-server

Sign up to request clarification or add additional context in comments.

1 Comment

This is the answer. I had to use the user that is specified under the directory security tab in IIS. I was trying to use the app pool user and that was the problem. Thank you!
0

Sounds like the database is expecting SQL Authentication instead of Windows Authentication.

1 Comment

The database itself or the database server. The database server is configured as mixed. The main database is using Windows authentication, so how can I get this new database to do the same?
0

In that case you have to add the login as a user to the database you want to use and give the appropriate permissions

3 Comments

You have misunderstood. In my original post I state: "When I switch the new app's connection string to use the sql server sa account, it works. I do not want to use the SA account." I am trying to use the Windows Network service account (which is working for another database on the same server!)
You need to add that user to the other database
Again, I stated just that in my question: "I added the network service account to the new application's database's users and granted db_owner, just like the root site's db is set up." Did you read my question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.