Wednesday, March 7, 2012

error 40. Get the error locally, but not remotely!

I've got a windows 2003 server running sql server 2005. When I run a web sit
e
on a desktop machine, there is no problem connecting to the database.
But, when I run the same web site with the same connection string on the
2003 server, I get the following error:
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
Obviously remote connections and tcp are enabled. My guess is that there is
something stopping IIS from connecting to the databse. The firewall is
disabled (not that it should interfere with local activities anyway).
I've been struggling with this one for a couple days. Any help would be
greatly appreciated.The problem seemed to have fixed itself after I upgraded to Service Pack 1
for SQL 2005. I don't know if that was the problem.
"Trevor Murphy" wrote:

> I've got a windows 2003 server running sql server 2005. When I run a web s
ite
> on a desktop machine, there is no problem connecting to the database.
> But, when I run the same web site with the same connection string on the
> 2003 server, I get the following error:
> An error has occurred while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default settings SQL Server does not allow remote connections.
> (provider: Named Pipes Provider, error: 40 - Could not open a connection t
o
> SQL Server)
> Obviously remote connections and tcp are enabled. My guess is that there i
s
> something stopping IIS from connecting to the databse. The firewall is
> disabled (not that it should interfere with local activities anyway).
> I've been struggling with this one for a couple days. Any help would be
> greatly appreciated.

No comments:

Post a Comment