1
I have publish my website in IIS7. It is running in DefaultAppPool. The Identity of this app-pool is set to LocalSystem. The IIS is running and I can run the application from IIS without any problem.
Now I want to attach the database placed in inetpub's application folder:
C:\inetpub\wwwroot\EMSApplication\App_Data\ASPNETDB.mdf
I have added new logins in the SSMS which are: NT AUTHORITY\NETWORK SERVICE
and IIS APPPOOL\DefaultAppPool
.
But when I am trying to attach that database in the SSMS I am getting follwoing error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Failed to retrieve data for this request.
(Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
------------------------------ ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\inetpub\wwwroot\EMSApplication\App_Data\ASPNETDB.MDF'. (Microsoft SQL Server, Error: 5123)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.5500&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476
Thanks. Can you please tell me what is the name of the user account of SQL Server? – Tapas Bose – 2012-03-24T14:47:02.217
It's going to look something like SQLServerMSSQLUser$ComputerName$InstanceName – Matthew Ruston – 2012-03-24T14:52:42.347