473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DB Connection Error

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
Mar 27 '07 #1
4 5921
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.
-----------------------
"George Shui" <Ge********@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
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

Mar 28 '07 #2
I finnally found the problem. Maybe a little bit stupid.I do not specify the
port in the connection string.

"George Shui" wrote:
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
Mar 30 '07 #3
Why do you have to name the port? I don't have to do that for mine to work.

Robin S.
----------------------------
"George Shui" <Ge********@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
>I finnally found the problem. Maybe a little bit stupid.I do not specify
the
port in the connection string.

"George Shui" wrote:
>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

Mar 30 '07 #4
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.

"RobinS" wrote:
Why do you have to name the port? I don't have to do that for mine to work.

Robin S.
----------------------------
"George Shui" <Ge********@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
I finnally found the problem. Maybe a little bit stupid.I do not specify
the
port in the connection string.

"George Shui" wrote:
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


Apr 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
We've had a recurring problem where all of a sudden we get a DBMSSOCN General Network Error on any page that connects to SQL Server. Then we have to reboot the server and everything works fine...
2
by: Jozef | last post by:
Hello, I'm trying to create a central function that runs a connection to an SQL Server database. The connection etc works, but when I try to call it, I get an error saying "Runtime-Error 91:...
6
by: Chris Szabo | last post by:
I've created a data access layer for a .NET web application. I'm using C# and framework 1.1. I'm getting an error from time to time when I close a connection saying: ...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.