Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

Last post 10-10-2007 6:29 AM by thithi. 10 replies.

Sort Posts:

  • Sleep [|-)] Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-10-2007, 4:25 AM
    • Loading...
    • niting80
    • Joined on 04-10-2007, 8:03 AM
    • Posts 5

    I have a web application developed in VS.NET 2005 [using C# as code behind]; and it uses SQL Server 2000 Enterprise edition as backend.

    The application runs fine, though it gives an error on IRREGULAR intervals on SQL data requests.

    Error Details:

    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)

     

    My problem is this:

    1) Why does it show an error of SQL 2005, while I use SQL 2000. SQL 2005 is not even installed on the server, though VS.NET 2005 is installed.

    2) The error comes only at irregular intervals. Users are able to login properly otherwise.

    3) Application starts working again if we do either of the following:  (a) Restart IIS   (b) Restart application pool   (c) Restart server.

    4) Named pipes and TCP/IP are added to the "Network Configuration" of the SQL server 2000.

    5) Error does not come on any specific page; or any specific code; or at any specific time.

    6) We do not have any background service or any other activity happening on the server; and the server hosts only this application, within a single virtual root.

     

    Any thoughts on why is this happening, and how to resolve this?

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-12-2007, 12:33 AM
    • Loading...
    • niting80
    • Joined on 04-10-2007, 8:03 AM
    • Posts 5
    This is reallsy started to cause me a serious problem now. Does anybody have any suggestion?
  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-12-2007, 12:33 AM
    • Loading...
    • niting80
    • Joined on 04-10-2007, 8:03 AM
    • Posts 5
    This is really started to cause me a serious problem now. Does anybody have any suggestion?
  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-13-2007, 4:57 AM

    Hi,

    The error message is just a basic connectivity error meaning the client could not connect to the target SQL Server.   So just follow the basic connectivity troubleshooting guidelines on our SQL Protocols blog, see:
    SQL Server 2005 Connectivity Issue Troubleshoot - Part I
    http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx
    and
    SQL Server 2005 Connectivity Issue Troubleshoot - Part II
    http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx
    This should help you debug the problem.

    Sincerely,
    Kevin Yu
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-13-2007, 5:28 AM
    • Loading...
    • niting80
    • Joined on 04-10-2007, 8:03 AM
    • Posts 5

    Hi Kevin

     I went through these pages already. The issue is:

    1. I dont have any component or instance of SQL 2005 installed on the server

    2. The named pipes are already added. One proof is that - application works normally.

    But something happens internally that SQL gets too busy or unavailable. I have SQL Enterprise Manager 2000.

     Can I check the logs in SQL 2000 / IIS to identify this cause? If yes, how?

     

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-17-2007, 12:04 AM

    Hi,

    Which SQL server are you connecting to, as you don't have any instance of SQL 2005 installed on the server.

    Also, I would suggest you to test connection using the .udl. Here are the steps:

    1. Create a normal Text file.
    2. Rename it to .udl extension.
    3. Double click on that file and a Data Link Properties dialog box will be show.
    4. Select the provider and data source, specify username and password, and click the Test Connection button for test.

    Sincerely,
    Kevin Yu
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Mark as Not Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    04-17-2007, 9:25 AM
    • Loading...
    • rjb
    • Joined on 02-27-2003, 9:30 AM
    • Posts 16

    I am experiencing this same issue and have been trying to resolve the issue for the past several days (almost a week now).  Curiously, my problem started last week without any change to the server, my application, or to the network.

     One thing that was suggested to me is to use an IP address instead of the server name in the connection string.

     I will keep you posted as I continue to try and resolve my problem.

    ROB
     

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    07-20-2007, 2:30 AM
    • Loading...
    • alatorre
    • Joined on 07-20-2007, 6:19 AM
    • Posts 2

     

    Hello, we are facing the same error, W2003 R2, SQL 2000 SP4, IIS6.0.

     

    Why it comes with a SQL 2005 error if we do not have it installed?

    We tried what you suggest (udl) and the connection is successful.

    If we try with oSQL /S<servername> /E it shows a 1> and the 2> until we type exit, if we try with oSQL /S<servername>\pipe\sql\query /E it shows the error "SQL Server does not exists or access is denied.  ConnectionOpen (Connect())"

    but in ASPX, when i try to access it, it cames with the error shown in this thread.

    Thanks, I really need your help.

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    07-26-2007, 1:34 PM
    • Loading...
    • cfrancis
    • Joined on 07-24-2007, 8:06 PM
    • Posts 1

    To reduce your computer's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled.  To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or MSDE.

     I was getting the same error and after updating my SP .. Error was gone.
     

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    07-26-2007, 2:41 PM
    • Loading...
    • alatorre
    • Joined on 07-20-2007, 6:19 AM
    • Posts 2

     

    Hello, Thanks for your responses,

     

    I found the solution to my problem that it is a MS Bug, please check the link

     http://forums.asp.net/p/1077899/1587696.aspx

    thanks.

  • Re: Irregular error in SQL 2000-Named Pipes Provider, Error: 40, could not establish connection

    10-10-2007, 6:29 AM
    • Loading...
    • thithi
    • Joined on 03-03-2005, 3:41 AM
    • Belgium
    • Posts 53

    Hi,

    I had the same problem.

    Check this Registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo.

    Are there any entries that reference the SQL server you want to use (DBMPNTW = named pipes)? If so remove them.

    Regards,

    Thierry
    Please click "Mark as Answer" if my reply solved your problem.

    Thanx
Page 1 of 1 (11 items)
Microsoft Communities
Page view counter