A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p

Answered A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p

  • Thursday, November 29, 2012 7:51 PM
     
     

    I get this error when trying to connect to a SQL Server 8 R2 that is located on the same machine:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

    I am not trying to connect to a remote machine, but I am connecting as a Domain Admin of the domain the machine making the query is in.

    Here is the connection string being used in the source code: Data Source=LUKE\NICK;Initial Catalog=MARS_DEV;Integrated Security=True

    LUKE\NICK is the name of the instance of the SQL Server machine.  LUKE is the name of the machine I am using.

    Other information:

    1.  I can connect to LUKE\NICK form LUKE with the VS 2010 Server Explorer without error.

    2.  I can connect to LUKE\NICK from LUKE with the   Management Studio without Error.

    I have followed the trouble shooting procedures given in other posts regarding this message, but the difference in all of the other posts regarding this error is that I am not trying to connect to a remote SQL Server instance.  The instance I am trying to connect to is on my local machine.....

    Thanks in advance for any information you can give me to help resolve this issue.

    Thanks,

    Tom


    Tom Childers, Radio Amateur N5GE, Licensed since 1976, QCWA Member 35102, ARRL Life Member

All Replies

  • Thursday, November 29, 2012 8:50 PM
     
     Answered

    When connecting to SQL Server from a client (such as Management Studio) on the same computer, the SQL Server Native Client will use the shared memory protocol. (That's a type of named pipe [a local pipe] so you sometimes get pipe error messages.) Your attempt is receiving a TCP error message. Your client is attempting a TCP connection. Most likely your SQL Server is not listening on TCP. Easy fix (I hope) is to enable TCP for SQL Server using SQL Server Configuration Manager. That could permit connections from other computers so it might not be your choice.

    Harder fix, figure out why your connection attempt is using TCP. Perhaps you are using old client software? Are you using an ODBC data source? Try dropping and recreating your data source.


    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

  • Thursday, November 29, 2012 8:50 PM
     
     
    Or maybe just creating and using a new one would be safer.

    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

  • Thursday, November 29, 2012 9:13 PM
     
     

    Thank you! Thank You! Thank you!

    I have been looking at the configuration settings for three days and not looking at the Native Client settings.  You were right!  The native client settings had a setting assigning TCP to LUKE\NICK.

    I think I'll have a margarita and celebrate!

    Thanks again,

    Tom


    Tom Childers, Radio Amateur N5GE, Licensed since 1976, QCWA Member 35102, ARRL Life Member