I am trying to migrate a website using MSSQL from MS Windows Server 2003 to a Server running MS WS 2008.

It's been a while since I tried the last time (because I gave up on this problem) so I may don't remember correctly everything I made in the past.

What I have done in a nutshell: export/import IIS config and ODBC config and moved the db.


My ODBC connection seems to run fine because the setup tool says so and I can access the SQL server via MS-SQL Server Management Studio by selecting the SQL server.

The Authentication is Windows-Authentication using the Administrator.

However I can not connect using vbscript (?). Opening the website via http gives me an error on these lines:

var conn = Server.CreateObject("ADODB.Connection");

I got the message that the db could not be found or it has no rights.

Now I checked again and it says error "trying to login" (Maybe I translated it wrong, error message is german.).


I have the hypothesis that the IIS process has no rights to access the MSSQL DB and I read that I have to grant the site in IIS administrator rights.

Can this be the cause of the problem and then how can I grant it (website or process...) more rights?


Check the IIS7 application pool identity for your site and make sure that the process the application pool is running as has the appropriate privileges to access SQL.

enter image description here

Click the pool in question, then Advanced Settings on the right. You can change the Identity the Application Pool runs as there, by clicking the "..." to the right of the identity listed. For more information, see this link.

  • Thanks for your answer. I am a bit stuck at the "make sure that the process [...] has the appropriate privileges" The site has been running as "NetworkService" process and is currently doing so. Is it possible to change rights for the network service? I also opened the SQL DB in SQL Server Manager and tried using an admin account in the db as the pool identity. – Benedikt S. Vogler Feb 26 '14 at 10:24
  • If SQL is running on the same box, then yes, you'll need to grant more privileges to NT AUTHORITY\NetworkService. If it's on another box, DOMAINNAME\YourWebServer$ would need to be granted access instead. For later versions of Windows I'd suggested a Managed Service Account instead, and implementing a non-privileged domain account might be more secure than NetworkService, but as to your actual question, :) yes, you can certainly give NetworkService rights to this database. – Katherine Villyard Feb 26 '14 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.