DB Connection Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have got an error message when connecting to Sql Server.

The error message is "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)".

We have both Sql Server 2000 and Sql Server 2005 installed on that DB
Server, but our database used for this application is Sql Server 2000.And my
connection string is "Server=ServerName;initial
catalog=databasename;uid=***;pwd=***"

Anyone can help me? Thanks in advance
 
Run the Surface Area Configuration and make sure that you have remote
connections enabled for both named pipes and TCP/IP.

If that isn't your problem, check your firewall -- you may have to add the
ports for SQLServer in there. If you search MSDN for "firewall SQLServer",
you will probably find the article.

Robin S.
 
I finnally found the problem. Maybe a little bit stupid.I do not specify the
port in the connection string.
 
Why do you have to name the port? I don't have to do that for mine to work.

Robin S.
----------------------------
 
Sorry. I have such a long time to make the reply.

Because we do not use Microsoft default port 1433. So we should specify the
port number in the connection string.

Or maybe we have not installed SP4 in the DB server.
 
Back
Top