I having the following error message:
Cannot open database "SmallBakery" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\MyAppPool'
How can correct this? I am using windows 7 Enterprise Edition and Sql server 2012.
asp.netiis-7sql server
I having the following error message:
Cannot open database "SmallBakery" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\MyAppPool'
How can correct this? I am using windows 7 Enterprise Edition and Sql server 2012.
Best Answer
If you don't change, each app pool has it's own identity. In your case, just add a new user to your database
SmallBakery
with the nameIIS APPPOOL\MyAppPool
using SQL Management Studio. You find the users list in the "Security/Users" subnode of your database. This should look something like that:For testing, let the user be member of the
db_owner
role. If that works, remove this role and just let it be member ofdb_datareader
anddb_datawriter
.This way, each app pool (perhaps each website, if they all use their own app pool) only has access to the corresponding database.