0

Background

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.

Situation

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");
conn.Open("DSN=xxx");

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.).

Question

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?

1 Answer 1

1

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.

2
  • 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. Feb 26, 2014 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. Feb 26, 2014 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .