none
Can not connect to SQL Server

    Question

  • I installed SQL Server 2005 (server and client components) on Windows Server 2003 with SP1. I can connect to this sql server from any other machine. However, I can not connect from this machine to sql servers on other machines. I have tried named pipe and TCP/IP. Neither of them works. The error message is can not establish connection. Any suggestion?

     

    Thanks,

    Thursday, April 13, 2006 3:21 PM

Answers

  • Also, if you're connecting to a named instance, make sure that you're either specifying the port number in the connection string or you have SQL Browser running on the server machine.

    Thanks,
    Il-Sung.

    Thursday, April 13, 2006 6:10 PM

All replies

  • What is the exact error message ?

    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---
    Thursday, April 13, 2006 5:04 PM
  • Here is the error message:

    An error has occured while establishing a connection to 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 - Cound not open  a connection to SQL Server) (Microsoft SQL Server, Error 53)

    Had enabled the remote connection from other server and can connect that server from other machines.

    Thanks,

    Thursday, April 13, 2006 5:40 PM
  • Is a firewall (Perhaps the WIndows default one) installed and configured on the server ? Perhaps then outgoing traffic on the ports is restricted.

    -Jens.
    Thursday, April 13, 2006 5:56 PM
  • Also, if you're connecting to a named instance, make sure that you're either specifying the port number in the connection string or you have SQL Browser running on the server machine.

    Thanks,
    Il-Sung.

    Thursday, April 13, 2006 6:10 PM
  •  

    Hello,

     

    I tried all the things, but it does not help me to solve the problem. I still get the ERROR - 40, could not connect to the remote computer.

    I checked the TCP/IP is enabled and port is standard - 1433.

    The problem with me was I tried to uninstall the sql server, and reinstall it.

    But when I uninstall everything from Add/ Remove Programs still I see it in START- Programs- Microsoft SQL Server.

    So I delete everything from the Registry.

     

    Now it let me install the SQL Server on it but I cannot install Database Engine , it says instance is already installed.

    Then after finishing my installation i tried to connect via the Management Studio but then i get this error but from here I can coonect to other Instance from other server.

    Could you help me in this.

     

    Regards,

    Sanja

    Tuesday, October 02, 2007 7:19 AM
  • Turn enable remote connections on firewall options in windows 2003 server machine. Then, enable "file and print sharing".

     

     

    Tuesday, October 02, 2007 9:47 AM
  •  

    I tried this, but still I am getting the same error 40, enable to connect to Remote computer.

     

    thanks,

    SanjaK

    Tuesday, October 02, 2007 12:30 PM
  • Verify if the instance is started.

    on command prompt execute services.msc and see if you the sqlserver is started.

    also, verify if you instaled this sql server as a named instance. On services you'll see the sql server as MSSQL$instancename, so, in this case, your sql server is "servername\instance" and all strings you'll have to connect using servername\instancename as a name of this server.

    Tuesday, October 02, 2007 12:58 PM
  • Hello Emanuel,

     

    thanks for your reply, and I checked sql server is not started on this server, and if I am trying to start it, i get this error message.

     

    "ERROR -2 SYSTEM CANNOT FIND THE FILE SPECIFIED"

     

    But as I told you in my last post that I install the sql server again but it does not let me install the sql server instance.

    And when I try to uninstall everything from this server (ADD/REMOVE Programs), still I see the SQL server install on the server.

     

    Tell me what should I do to uninstall and reinstall it so that it works.

     

    thanks,

    sanjak

     

     

    Thursday, October 04, 2007 7:49 AM
  • Hi, Try the following connection string:

    Dim connection As New SqlConnection("Data Source=Server_Name;Initial Catalog=DataBase_Name;Integrated Security=true")
    
    Wednesday, May 25, 2011 10:38 AM