As you described, this problem occurs when rebooting the web server.
Therefore, how did you make it works most of time. Please check the
following information to see if it helps you:
There are two causes for this error. Both errors are permission-related
and involve a database that is either on a different computer from the Web
server, or the database is possibly being referenced using a UNC path
(\\Server\Share). Even if the database is on the same computer as the Web
server, UNC paths make the database appear to the Web server to be on a
different computer on the network.
- The following is true if the .asp page is accessed by an anonymous user:
IIS will use (by default) a Windows NT account called:
This account is local to the Web server and is essentially unknown to any
other computers on the network. When IIS, operating under the security
context of the IUSR account, tries to access any resources on a remote
computer, the remote computer tries to validate the account being used.
Because the IUSR account is a local account that is unknown to the remote
computer, access is denied.
There are two solutions when anonymous access causes this problem:
- In the Internet Service Manager tool, under Web Properties, change the
anonymous logon account from the default local account to a valid
domain-based account. In the UserName field, enter the domain account
use as 'domain\userid'. This way, the remote computer can check with
domain controller to validate the security credentials passed to it by
- Duplicate the
account on the remote computer that contains the resource you want to
access. If an account is created on the remote computer that has the
same name and password, Windows NT treats them as equivalent accounts.
- If the .asp page only allows authenticated access, please refer to the
If the page does not allow anonymous access, IIS tries to authenticate
user making the request, and uses their security credentials for all
activities such as database accesses. The two primary causes for a
this scenario are described below.
- By default, IIS is configured to use Windows NT Challenge/Response as
authentication method. Because of limitations in the Windows NT 4.0
prior versions) security model, a user that has been authenticated
Windows NT Challenge/Response cannot access resources on remote
This is commonly referred to as a delegation problem. To verify if
the case, in the Internet Services Manager tool, under Web properties,
select the Basic (Clear Text) check box and CLEAR the Windows NT
Challenge/Response. If this solves the problem, then this is a clear
- If problems persist, it is likely that the User account being used
not have rights to the SQL Windows NT computer. Try using an account
has known access to the SQL computer.
For more information concerning delegation, how IIS uses authentication
secure a Web site, and problems such as this, please see the article "IIS
Authentication and Security for Internet Developers" located at this Web
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security
| Content-Class: urn:content-classes:message
| Subject: recurrent inability to connect to SQL after reboot
| Date: Fri, 23 May 2003 14:02:54 -0700
| Lines: 19
| MIME-Version: 1.0
| Content-Type: text/plain;
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcMhbq3jIi1X9UAOSGWFwtbkVMFEOA==
| Newsgroups: microsoft.public.data.ado
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.data.ado:60193
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.data.ado
| I have a web application that connects to SQL Server
| without problems most of the time. However, every time the
| web server is rebooted, after it comes back up the
| connection to the database stops working for an
| unpredictable amount of time.
| The web server and SQL Server are on separate machines.
| Other web servers are able to connect to SQL Server
| without problems, using the same application with the same
| login, password, connection string, and code.
| The error occurs when I call the connection.open method.
| The error message is "Access is denied".
| Exception type is System.UnauthorizedAccessException.
| I'm using SQL Server authentication to connect.
| Are there any known bugs that could be causing this? Are
| there any workarounds?