Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top