none
error: 26 - Error Locating Server/Instance Specified

    Question

  • When trying to connect to a SQL server instance, I get this error:

    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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)

    It happens with:

    • SQL Server Management Studio:
      Microsoft SQL Server Management Studio      10.0.2531.0
      Microsoft Analysis Services Client Tools      10.0.1600.22
      Microsoft Data Access Components (MDAC)      6.1.7600.16385
      Microsoft MSXML      3.0 4.0 5.0 6.0 
      Microsoft Internet Explorer      8.0.7600.16385
      Microsoft .NET Framework      2.0.50727.4927
      Operating System      6.1.7600
    • ApexSQL Edit:
      Version 2008.09.0168
    • My LINQ To SQL application

    However, Visual Studio 2008 can connect to this server/database:

    Microsoft Visual Studio 2008 
    
      Version 9.0.30729.1 SP 
    
      Microsoft .NET Framework 
    
      Version 3.5 SP1
    
    Installed Edition: Enterprise
    
    Microsoft Visual Basic 2008   91899-270-6409887-60038 
      Microsoft Visual Basic 2008
    
    Microsoft Visual C# 2008   91899-270-6409887-60038 
      Microsoft Visual C# 2008
    
    Microsoft Visual C++ 2008   91899-270-6409887-60038 
      Microsoft Visual C++ 2008
    
    Microsoft Visual Studio 2008 Team Explorer   91899-270-6409887-60038 
      Microsoft Visual Studio 2008 Team Explorer 
    
      Version 9.0.30729.1
    
    Microsoft Visual Studio 2008 Tools for Office   91899-270-6409887-60038 
      Microsoft Visual Studio 2008 Tools for Office
    
    Microsoft Visual Studio Team System 2008 Architecture Edition   91899-270-6409887-60038 
      Microsoft Visual Studio Team System 2008 Architecture Edition
    
    Microsoft Visual Studio Team System 2008 Database Edition   91899-270-6409887-60038 
      Microsoft Visual Studio Team System 2008 Database Edition
    
    Microsoft Visual Studio Team System 2008 Development Edition   91899-270-6409887-60038 
      Microsoft Visual Studio Team System 2008 Development Edition
    
    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V.  All rights reserved.
    
    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company.  Electronic version licensed from Lernout & Hauspie Speech Products N.V.  All rights reserved.
    
    
      Microsoft Visual Studio Team System 2008 Test Edition   91899-270-6409887-60038 
    
      Microsoft Visual Studio Team System 2008 Test Edition
    
    Microsoft Visual Web Developer 2008   91899-270-6409887-60038 
      Microsoft Visual Web Developer 2008
    
    CodeIt.Right   1.8.9300.0 
      For more information about CodeIt.Right, see the SubMain website at http://submain.com. Copyright © 2002-2009 SubMain, a Division of vbCity.com, LLC.
    
    CodeRush for Visual Studio   9.3
    
    Crystal Reports    AAJ60-G0MSA4K-68000CF 
      Crystal Reports Basic for Visual Studio 2008
    
    
      DXCore for Visual Studio   9.3 
    
      DXCore for Visual Studio
    
    GhostDoc   2.5.9166.0 
      GhostDoc - Visual Studio add-in for automatically creating XML documentation comments.
    
    Hotfix for Microsoft Visual Studio 2008 Team Explorer - ENU (KB946260)   KB946260 
      This hotfix is for Microsoft Visual Studio 2008 Team Explorer - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946260.
    
    Hotfix for Microsoft Visual Studio 2008 Team Explorer - ENU (KB946458)   KB946458 
      This hotfix is for Microsoft Visual Studio 2008 Team Explorer - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946458.
    
    Hotfix for Microsoft Visual Studio 2008 Team Explorer - ENU (KB948816)   KB948816 
      This hotfix is for Microsoft Visual Studio 2008 Team Explorer - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/948816.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB944899)   KB944899 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/944899.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB945282)   KB945282 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/945282.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB946040)   KB946040 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946040.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB946308)   KB946308 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946308.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB946344)   KB946344 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946344.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB946581)   KB946581 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946581.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB946673)   KB946673 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/946673.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB947171)   KB947171 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947171.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB947173)   KB947173 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947173.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB947180)   KB947180 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947180.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB947540)   KB947540 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947540.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB947789)   KB947789 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947789.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB948127)   KB948127 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/948127.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB953256)   KB953256 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/953256.
    
    Hotfix for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB971092)   KB971092 
      This hotfix is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this hotfix will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/971092.
    
    Microsoft StyleCop   4.3 
      Provides source code style and consistency tools.
    
    Microsoft Visual Studio Team System 2008 Team Suite - ENU Service Pack 1 (KB945140)   KB945140 
      This service pack is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this service pack will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/945140.
    
    Microsoft Visual Studio Team System 2008 Team Suite - ENU Service Pack 1 (KB947888)   KB947888 
      This service pack is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this service pack will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/947888.
    
    Microsoft Visual Studio Team System 2008 Team Suite - ENU Service Pack 1 (KB948484)   KB948484 
      This service pack is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this service pack will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/948484.
    
    Oracle Developer Tools for Visual Studio   11.1.0.6.20 
      Oracle Developer Tools for Visual Studio Copyright (c) 2005, 2007
    
    Process Editor WIT Designer   1.4.0.0 
      Process Editor for Microsoft Visual Studio Team Foundation Server, Version 1.4.0.0
    
    Refactor! for Visual Studio   9.3 
      Refactor! for Visual Studio
    
    Security Update for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB972222)   KB972222 
      This security update is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this security update will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/972222.
    
    Security Update for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB973675)   KB973675 
      This security update is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this security update will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/973675.
    
    SQL Server Analysis Services   Microsoft SQL Server Analysis Services Designer 
    
      Version 10.0.2531.0
    
    SQL Server Integration Services   Microsoft SQL Server Integration Services Designer 
    
      Version 10.0.2531.0 ((Katmai_PCU_Main).090329-1015 )
    
    SQL Server Reporting Services   Microsoft SQL Server Reporting Services Designers 
    
      Version 10.0.2531.0
    
    Team Foundation Server Power Tools   October 2008 
      Power Tools that extend the Team Foundation Server integration with Visual Studio.
    
    Update for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB956453)   KB956453 
      This update is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this update will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/956453.
    
    Update for Microsoft Visual Studio Team System 2008 Team Suite - ENU (KB967143)   KB967143 
      This update is for Microsoft Visual Studio Team System 2008 Team Suite - ENU. 
    
      If you later install a more recent service pack, this update will be uninstalled automatically. 
    
      For more information, visit http://support.microsoft.com/kb/967143.
    
    NDepend.AddIn 
      NDepend.Addin 
    
      http://www.NDepend.com 
    
      Copyright (c) 2004-2008  SMACCHIA.COM SARL
    
    SQL Prompt 4.0 
      For more information about SQL Prompt, see the Red Gate website at 
    
      http://www.red-gate.com 
    
      For customer support, call 1-866-733-4283. 
    
      Copyright © 2006–2009 Red Gate Software Ltd
    
    Typemock Isolator 
      For more information about Typemock Isolator, see the Typemock website at 
    
      http://www.Typemock.com 
    
      For customer support, use the forums on the site 
    
      Copyright (c) 2005 Typemock ltd.
    
    TypeMock Productivity 
      For more information about Microsoft, see the Microsoft website at 
    
      http://www.Microsoft.com 
    
      For customer support, call 1-800-xxx-xxxx. 
    
      Copyright (c) 2009-2010 Typemock Ltd. 
    

    If I turn the client machine's (Windows 7 Enterprise x64) Firewall (Windows) for domain networks, all applications can connect successfully.

    I can successfully connect to many servers and databases in the same domain as this one without having to turn off the firewall. What's happening here?


    Paulo Morgado (http://PauloMorgado.NET/)
    Wednesday, February 10, 2010 9:56 AM

Answers

  • The problem is not the server's TCP port (or at least, that's not the immediate problem). The error "SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified" specifically means that the client could not talk to the SQL Browser service on UDP port 1434. If removing the firewall fixes the problem, then opening up that specific port should resolve this particular error. You may then have to open the SQL Server TCP port, later, if you have different problems, but for now this will at least let you move forward.
    Friday, February 12, 2010 5:39 PM
    Moderator

All replies

  • Hi Paulo,
    Windows Firewall will block the TCP port on which your SQL Server instance is listening or connections with named pipes protocol. However you do not need to turn off your Windows Firewall, instead just add the TCP port to the Exception list of your Windows firewall. After than you should be able to connect to your SQL Server.

    You can first check your SQL Server instance's listening TCP port via Start->All Programs->Microsoft SQL Server 2008->Configuration Tools->SQL Server Configuration Manager->SQL Server Network Configuration->Protocols for MSSQLServer. Make sure that TCP/IP protocol is enabled. if not, enable it first and then restart your SQL Server service. Then double click TCP/IP protocol, switch to the IP Addresses and you can find the TCP port. By default it is 1433. Once you identified the TCP port, open your Windows Firewall and configure your firewall to allow the connection to the TCP port:
    Open a port in Windows Firewall
    http://windows.microsoft.com/en-us/windows-vista/open-a-port-in-windows-firewall

    Best regards,
    Charles Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, February 11, 2010 10:48 AM
    Moderator
  • How can I know the TCP port given that I do not have any access to that SQL Server's Configuration Manager? The only information I have is:

    • server name
    • server instance
    • database name
    • user name
    • password

    Visual Studio 2008's Server Explorer can successfully connect and retrieve data. SQL Server 2008 Management Studio, ApexSQL Edit and my .NET application can't. Why is this a client firewall problem?


    Paulo Morgado (http://PauloMorgado.NET/)
    Thursday, February 11, 2010 2:32 PM
  • Hi Paulo,
    I had thought that it was a firewall issue at server side, however it looks that I misread your information now.

    I notice that you are using Windows 7 as the client on which the windows firewall has improved a lot. Please check if you ever define an outbound rule in your Windows firewall. Here are some articles for your reference:
    Create an Outbound Program or Service Rule on Windows 7, Windows Vista, Windows Server 2008 or Windows Server 2008 R2
    <!---->
    http://technet.microsoft.com/en-us/library/cc947786(WS.10).aspx
    Create an Outbound Port Rule on Windows 7, Windows Vista, Windows Server 2008 or Windows Server 2008 R2
    <!---->http://technet.microsoft.com/en-us/library/cc947789(WS.10).aspx
    Enable Predefined Outbound Rules on Windows 7, Windows Vista, Windows Server 2008, or Windows Server 2008 R2
    <!---->http://technet.microsoft.com/en-us/library/cc947820(WS.10).aspx

    Best regards,
    Charles Wang

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Proposed as answer by JMaloney Sunday, June 26, 2011 4:25 PM
    Friday, February 12, 2010 10:03 AM
    Moderator
  • The problem is not the server's TCP port (or at least, that's not the immediate problem). The error "SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified" specifically means that the client could not talk to the SQL Browser service on UDP port 1434. If removing the firewall fixes the problem, then opening up that specific port should resolve this particular error. You may then have to open the SQL Server TCP port, later, if you have different problems, but for now this will at least let you move forward.
    Friday, February 12, 2010 5:39 PM
    Moderator
  •  

    Hi Charles,

     

    I tried to go to the place you have advised... how to switch to the IP Addresses and find the TCP port...

     

     

     

     

     

    Also. where is the place to add port in Firewall?

     

     

    Saturday, August 06, 2011 5:27 AM