Welcome to MSDN Blogs Sign in | Join | Help

SQL Protocols

Topics from the Microsoft SQL Server Protocols team - Netlibs, TDS, SQL Browser, etc...
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

Users often see this error message when connection to a SQL Server and don't know where to start to solve the problem. In most forums, people says this is because remote connection is not enabled on the server. This is not exactly correct. Actually, this error message give customers very specific information and the solution is quite simple.

First of all, you get this error message only if you are trying to connect to a SQL Server named instance. For default instance, you never see this. Why? Because even if we failed at this stage (i.e. error locating server/instance specified), we will continue to try connect using default values, e.g defaul TCP port 1433, default pipe name for Named Pipes. You may see other error message due to failure later, but not this error message.

Every time client makes a connection to SQL Server named instance, we will send a SSRP UDP packet to the server machine UDP port 1434. We need this step to know configuration information of the SQL instance, e.g., protocols enabled, TCP port, pipe name etc. Without these information, client does know how to connect the server and it fails with this specified error message.

In a word, the reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It's easy to isolate the issue. Here are the steps:
1) Make sure your server name is correct, e.g., no typo on the name.
2) Make sure your instance name is correct and there is actually such an instance on your target machine. [Update: Some application converts \\ to \. If you are not sure about your application, please try both Server\Instance and Server\\Instance in your connection string]
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.

Once you are done the steps, you should not see this error message anymore. You may still fail to connect your SQL server, but error message should be different and you have a different issue now. [Update: If it still fails, you may replace server\instance with tcp:server\instance and/or np:server\instance and see if it succeeds with either TCP or NP protocol. That way, you can isolate the issue a little bit. ]

There is one corner case where you may still fail after you checked step 1)-4). It happens when a) your server is a named instance on cluster or on a multi-homed machine, and b) your client is a Vista machine with Firewall on. I have explained the details at: Unable to connect to a SQL Server named instance on a cluster

[Update May 2009] My collegue found a good tool online which could be very helpful for users to isolate issues related to this error message. You can download PortQry from http://support.microsoft.com/kb/832919, run "portqry.exe -n yourservername -p UDP -e 1434". If this command returns information and it contains your target instance, then you can rule out possiblity 4) and 5) above, meaning you do have a SQL Browser running and your firewall does not block SQL Browser UDP packet. In this case, you can check other issue, e.g. wrong connection string.

 

As a final note, the error message for the same issue when you use SNAC is:
[SQL Native Client]SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

 

If you still see this error, please post questions at MSDN SQL Server Data Access Forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=87&SiteID=1 
Please mention you already read this post and confirm steps you have taken and the results of each step.(e.g. server\instance,etc)  

 

Xinwei Hong, SQL Server Protocols
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights

Posted: Sunday, May 13, 2007 11:28 PM by SQL Protocols

Comments

Rabi said:

great post.

I searched many places and everybody writes about remote connection is not enabled on the server.

I had that on but still it wasn't working. I was trying to connect to a SQL Server named instance. I had TCP port 1433 in exception but still didn't work.

Finally after I saw your post and especially step 4 where you mention to put UDP post 1434 in exception, everything is working now. That was very helpful.

# May 21, 2007 6:48 PM

AGeorge said:

Thank you so much.  I spent hours trying to figure this out and am glad I found this blog entry.  For me I was unable to use the UNC to resolve the IP so instead used the IP Address and was able to connect from SQL Server Mgmt Studio.

# May 27, 2007 1:42 AM

pRoFiOn said:

I made everthing.. what did U write..

my situation is:

SQL server 2005 TRIAL worked fine for 6-7 hours.. and then it stops accepting TCP/IP clients.. :S

where is the problem.. I added sqlbrowser.exe to firewall, UDP port 1434, and still nothing  

# May 29, 2007 4:31 AM

Xinwei Hong said:

Do you still see "error: 26" after you did everything? This is not supposed to fix all connection issues.

# May 29, 2007 3:16 PM

pRoFiOn said:

yes.. that error..

i dont understand.. server works fine.. and just stop accepting users from TCP/IP..

if I connect local(any protocol) it works.. just remote ppl cant access 2 MSSQL

# May 31, 2007 10:14 AM

Xinwei Hong said:

Can you tell me your connection string? Are you sure SQL Browser is running? What's the output if you run "sc query sqlbrowser" on server?

# May 31, 2007 1:19 PM

Manju said:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

# June 5, 2007 1:38 AM

profion said:

C:\Program Files\Microsoft SQL Server\90\NotificationServices\9.0.242\Bin>sc query sqlbrowser

SERVICE_NAME: sqlbrowser

       TYPE               : 10  WIN32_OWN_PROCESS

       STATE              : 4  RUNNING

                               (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)

       WIN32_EXIT_CODE    : 0  (0x0)

       SERVICE_EXIT_CODE  : 0  (0x0)

       CHECKPOINT         : 0x0

       WAIT_HINT          : 0x0

# June 5, 2007 5:06 PM

Xinwei Hong said:

Sorry, can you please tell me your connection string? Or at least, the server and instance name?

# June 5, 2007 5:49 PM

pRoFiOn said:

i usualy connect with SQL native client (Data sources [ODBC])

server 193.198.63.16\SQLEXPRESS (before it was SQL 2005 TRIAL )

username - test

passwd - test321

and sql server browser service is logined as local system.. and he is running

tcp/ip, pipes, shared memory are enabled, tcp/ip port - 1433

and error when i'm connecting :

http://img186.imageshack.us/my.php?image=hmmmci7.jpg

# June 7, 2007 11:41 AM

Xinwei Hong said:

Do you have a sqlexpress installed on that machine? Is it actually a default instance as you mentioned port 1433? Does that machine have multiple IP addresses? Did you check the link I mentioned in the post for exception?

http://blogs.msdn.com/sql_protocols/archive/2006/02/27/unable-to-connect-to-a-sql-server-named-instance-on-a-cluster.aspx

# June 7, 2007 1:32 PM

pRoFiOn said:

i fixed sql server..

I connect direct to instance with port..

i'm not using sql browser..

and it works fine..

thx :)

# June 11, 2007 1:28 PM

sjspain said:

Is there a way to do this programatically in C# (VS2005) in my application so that my installation is not thwarted by this and I don't have to walk my customers through this?

# June 12, 2007 7:38 PM

sjspain said:

Also, a related connection question:  My earlier downloads of SqlExpress named the instance of SqlServer 'SQLEXPRESS'.  A customer downloaded the newest version from the MS website and his instance is named 'MSSQLSERVER'.  My DB connection string is "Data Source=.\\SQLEXPRESS;Integrated Security=True;Connect Timeout=200;User Instance=True;database = LOCAL_RXDB", so does this mean that this string will never work with an instance named 'MSSQLSERVER'? Can I rename an instance on a machine?  Why does the SqlExpress download instance no longer install as 'SQLEXPRESS'?  Thank you so very much for any information you can give me.

# June 12, 2007 7:44 PM

Xinwei Hong said:

If your configuration is corret, you won't see this error (except for the special case). So, no need to do it  programatically.

By default, sqlexpress will install a SQL instance with "sqlexpress" as the instance name, however, you can specify other instance name or default instance when you install. You cannot change the instance name once you installed. Why don't you fix your connection string by using "Data Source=."? If it's due to the visual studio bug, (see here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1678480&SiteID=1), use the following workaround:

From Visual Studio, --> Tools menu --> Options --> Database Tools --> Data Connections -->

Change your "SQL Server Instance Name" from "sqlexpress" to blank.

Hope this help.  

# June 12, 2007 9:21 PM

sjspain said:

For reasons I do not understand, the connection fails with either "Data Source=.\\ etc" or "Data Source=. etc." , whether I have SQLEXPRESS running and MSSQLSERVER stopped or vice versa or both running on my dev machine.  My customer installed SqlExpress from the MS page, and it gave him an instance named 'MSSSQLSERVER'.  Has the instance name of the SqlServer download been changed to MSSQLSERVER?  This does not seem logical, but appears to be the case.

# June 12, 2007 11:29 PM

rstreeter said:

I was getting this same error, and I am still unfamiliar with many aspects of SQL 2005. After verifying the steps above, I was about to give up and try rebooting. Then I thought to simply restart the SQL Browser service and it worked.

Thanks for leading me down the right path.

# June 22, 2007 12:35 PM

Kevin Matzen said:

I am receiving this error after I have published my ASP.NET application from Visual Studio.  When running the site through Visual Studio, everything works perfectly fine.  However, after I publish it to IIS, anytime my code accesses the database, I receive error 26.  The sql server is located on the same computer as IIS.  TCP/IP, named pipes, and shared memory are enabled and VIA is disabled.  Server browser is running.  I have also tried the connection string with the ip address.  All options work fine in VS, but not in IIS.

Previously I had been receiving error 40, but then I reinstalled sql server and it is now error 26.

# July 6, 2007 2:04 PM

Kevin Matzen said:

Sorry to bother anyone with my previous problem.  'Tis solved.  I just reinstalled IIS, but also deleted the inetpub directory so that the permissions would be set upon installation.  Then I received better error messages that allowed me to configure my database's permissions.

# July 6, 2007 3:06 PM

Atif said:

<add key="strCommonDB" value="server=OASISM\SQLEXPRESS_05;database=CommonDB;uid=ohm;password=ohm"/>

Above is my connection string.

I have made all changes taht u specified. But getting still same error.

I am using SQLExpress addition with windows XP

# July 10, 2007 1:42 PM

Xinwei Hong said:

What application is this? Sometimes, application needs "\\" to replace "\". Can you try ...server=OASISM\\SQLEXPRESS_05....?

# July 10, 2007 1:53 PM

Atif said:

Hi,

I have been stuck up with this error.

I am using SQL Srver express edition with asp.net 2.0 on windows XP SP2.

When I open the SQL Management studio and execute queries it works fine.

When I exute query in command prompt using SQLCMD -E -S Servername\Instance

It conect with database and I can freely execute queries in command prompt.

I have also tried to connect with Classical ASP 3.0 It also works fine. No error

I have made all changes that u specified in ur article.

But When I try to connect with asp.net. It gives me error.

"provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

Connection string

<add key="strCommonDB" value="server=OASISM\SQLEXPRESS_05;database=CommonDB;uid=ohm;password=ohm"/>

I have also tried this

<add key="strCommonDB" value="server=OASISM\\SQLEXPRESS_05;database=CommonDB;uid=ohm;password=ohm"/>

# July 13, 2007 3:11 AM

Atif said:

Same files are  working fine in my office with SQL Server 2005 enterprise edition and ASp.net 2.0.  on Windows server 2003. I do not get this error. But at home I am facing this problem again and again.

# July 13, 2007 3:18 AM

Claudia said:

Thank you so much, you've no idea how many hours i spent trying to fix this. I visit alot of Forums and tutorial, and nothing.

But with you it really work. Thanks again you save my day.

# July 20, 2007 3:56 PM

Karthik said:

None of the above solved the problem for us. We are able to connect from same subnet; but not from other subnets. What could be the problem?

# August 2, 2007 10:12 AM

Ekennedy said:

I just migrated my development environment from Windows XP to Vista.  I read your post, but I'm still having trouble figuring our what I need to do.  My data connection is an existing "mdf" file on my local machine. Even though the file is local, do I need to somehow change the connection string to include a port number?  If so, can you point me to an example of how to do that?  Thank you.

# August 6, 2007 7:23 AM

Raf said:

                How do connect a sql server in a network.when i am connecting the server to client i am facing the network problem.The client is not accept the server.How can i Solve the problem?

# August 21, 2007 12:03 AM

Rodio said:

I'm trying to connect using the Asp.Net web site administration tool. I can see the database in the Visual Web developer 2005, but still unable to connect through the administration tool? Any solutions?

# September 5, 2007 9:58 AM

Marilyn Winborn said:

I am having the same error:26 problem.  My connection string is -

       <add name="teddbConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=&quot;|DataDirectory|teddb.mdf&quot;;Integrated Security=True;Connect Timeout=30;User Instance=True"            providerName="System.Data.SqlClient" />

The syntax of this string was recommended by an Expression Web tutorial.   The database works fine locally.  The only difference is that locally, I use the full dataset name instead of the |DataDirectory| - When I upload to my ISP I get the error.  Can you point me in the right direction?

Thanks.

# September 6, 2007 4:31 AM

pv said:

If you have 'sql network interfaces error 26' -' remote connection not possible...etc' and trying to attach SQL Express 2005, pls. try restarting the SQL Express 2005 from SQL Configuration Manager.

If you are using the Database in the SQL Server Management Studio and trying to connect with your code or from Visual studio, you get an error 'Another process is using' - Restarting the service helps.

# September 15, 2007 11:05 PM

Duva said:

Yeah...This was really helpful for me.  Especially the point number 4 resolved the issue.  

Thanks a lot

# September 17, 2007 2:05 PM

Elaine Mayer said:

I just want to share some info with you all. I have one user got the same error when connect to the named instance and our solution is to use the right TCP/IP port. Our named instance use a different port other than 1433. Once direct use to connect through the right port, everything works fine.

elaine

# September 19, 2007 10:59 AM

Matt said:

Great article solved my problem instantly.

Thanks.

# September 24, 2007 5:44 AM

TuAnh said:

I installs SQL server 2005 express on two computer in LAN. In one I used Microsoft SQL Server Management Studio Express remote connect to that, It's ok. But when i used connect string in C# to remote connect, It's error. Please help me.

Note:

conStr = "server=computer2\\SQLEXPRESS;database=dataname;pwd=password; uid=username; Trusted_Connection=false;Integrated Security=SSPI"

# September 26, 2007 12:24 AM

nicky said:

This is the way how I encounter the error 26.

I've everything works fine on my XP running with SQL Express. However, when I change the file system from FAT32 to NTFS, I encounter the error 26. The only way I can solve the problem is to goto the [MyComputer] >> [Manage] >> [Computer Management] >> [Services & Applications] >> [SQL Server Configuration Manager] >> [SQL Server 2005 Services]

there I change the built-in account from "Network Service" to "Local System". Then it works. However, when I change back to "Network Service", which is the default setting, it won't.

Can you help me ?

Nicky

Email : nicky@i-cyber.com.hk

# October 19, 2007 12:32 AM

Xinwei Hong said:

Can you use eventvwr.exe to check the eventlog for SQL Browser and post what are the failing error message when you run SQL Browser under Network Service account?

# October 19, 2007 1:43 AM

Valeen said:

Can you help me? Please. Ugh.

I've been asking for help on the forums and haven't been able to fix the error yet. I've tutorialled and searched and played around and nada. I'm still getting error 26 when I try to log on to the website.

I can ping the machine, I have firewall expceptions for both .exe files, tcp 1433 and 4774 and also udp1434. And sqlbrowswer is running.

More of my explanation can be found here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2402063&SiteID=1

PLEASE! help me.

# November 13, 2007 12:55 PM

Xinwei Hong said:

Valeen, I replied to you in the forum. Can you provide more information there? Thanks.

# November 13, 2007 1:21 PM

Valeen said:

perfect! and I've replied to you.

# November 14, 2007 12:39 PM

Henry said:

I have an instance, which I can connect to remotely with osql. But with Management Studio, I end up with Error 26. Any ideas? Thanks.

# November 16, 2007 3:19 PM

Pramod said:

Really really good soluion..

particularly 4 point 1434 sqlbrowser.exe in firewall

i wasted almosted half day to get this..

thank u

# December 5, 2007 1:12 AM

LT said:

This is too cryptic for me: "i fixed sql server.. I connect direct to instance with port.. i'm not using sql browser.. and it works fine.. thx :)Monday, June 11, 2007 1:28 PM by pRoFiOn "

Is there an overview of how "Create User Wizard" works?

I can't get it to work.  I've looked here and in VS 2005.  I've configured tool -> connect to database, and under options too.  Each time the connection test works fine, but not the Create User Wizard. I’ve started and stopped the SQL Server Service; I’ve dropped and recreated a test database.  All this is done to no avail. The “error 26” message is not very useful although long.  I know that TDS stands for tabular data stream.

I've looked elsewhere and there are references to the web config file.  Again the material is vague.

With SQL 2005 Dev Edition and IIS 5.1 on an XP sp2 install.  What does Visual Studio 2005 Standard Edition do with respect to the Create User Wizard?

Thanks in advance!

LT

# December 10, 2007 1:13 PM

LT said:

Make aspnetdb with aspnet_regsql.exe seems to be the solution to not getting the error 26 in my case.  I got the information from http://forums.asp.net/t/1150188.aspx

In that database there is a table called aspnet_Users that should hold users created by the "Create User Wizard" - again I got that info off of the Web.  

It works with an empty table.  I use BobX123$ as a test user name with all the other entries in the dialog being the same.  The user information is being stored somewhere, but I can't find it.  I've searched for multiple MDF files for the aspnetdb database, done SLQ traces - all do not yield the results I expect.  I can't find the persistent storage of the data the wizard/control uses.

Any ideas?

I am willing to start fresh.  I can't deploy technology that works magically!

Thanks in advance.

LT

# December 10, 2007 7:20 PM

Alan said:

In my case, my named sql 2000 instance is sitting behind a firewall seperated from the asp.net 2.0 web site. The named instance is running on TCP port 1570. My network guy has opened up that port, still I got this error. Do I have to open UDP 1434 as well? My connection string uses "server=IPAddress\instanceName", is that good enough?

When I tried using "server=tcp:IPAddress\instanceName,1570", I got this error:

ERROR 12/12/2007 11:35:09 PM 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

According to Ming LU's blog at http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx, that could be caused by windows firewall. But, the windows firewall on the sql server is turned off. Does this still points back to my corporate firwall being the cause?

Thanks.

-Alan

alan.tang@credit-suisse.com

# December 12, 2007 11:52 PM

Alan said:

After opening UDP 1434, and use "server=tcp:IPAddress\instanceName,1570" in the connection string, the problem was resolved.

# December 14, 2007 12:55 PM

abid said:

This error can happen when you don't have administrative rights on the database. In my case I was working on one application at school, when I took it home it gave me this error. At first I thought that is the remote connection. For that reason I canceled the access to the database, and the remote was working fine. I made a new database just for check and that worked fine. So I knew that it when I transfered that application to my system, the current user did not have rights to access the database.

# December 15, 2007 2:32 PM

mohan said:

Hi I created the Database using the LOGIN CONTROLS in visual web developer !!

I didnt done any programming !! What can i do , same 26 errors for mee too  !!

how to see the connection strings and port details !! Help me !!

# January 4, 2008 9:39 PM

zorch said:

Hi,

I just installed the x64 version of SQL EXPRESS Mgmt Studio onto a W2008 RC1 machine that had Sharepoint(WSS 3.0) installed.

I am trying to connect to the Sharepoint SQL Server ( Windows Internal Database )

I get this error msg error: 26

thx

zorch

# January 8, 2008 5:06 PM

david said:

I have tried everything and still no luck.

1. Can ping server name

2. Instance name is default MSSQLSERVER

3. Can use SQL Management Studio to connect fine

4. SQL Server Browser is running and confirmed with "sc query sqlbrowser"

5. Firewall is not running on the server, not running on my local Vista desktop and there is no physical firewall in between.

I've tried servername\mssqlserver and all variations of \\ and //.

Still getting error: 26.

# January 11, 2008 9:58 AM

Duan Wang said:

Thanks a lot for such a clear and pin to the point solution.  The cause of mine is that the server has two network cards with two IPs. One is for general network connection include SQL 2005 and the other is for server management. So when I use <servername>, it didn't map to the correct IP.  So I give the IP in place of servername it worked.

# January 15, 2008 3:33 PM

micharch said:

Wow this error means your Instance doesn't exisit. Go to your Surface Area Manager, your Instance is name after the Dollar sign: ie MSSQL$OFFICESERVERS, in this case the Instance name is OFFICESERVERS. Type your Instance behind your server name in the Server Setup Wizzard, ie 'yourserver\officeservers'.

# January 22, 2008 7:09 PM

Ryan said:

In vista I found the culprit to be Windows firewall. Something there is blocking connections to virtual servers. I am able to connect to an original db using SQL server management studio for 2005 but connecting to any virtual servers even those on the original was a no go with the firewall enabled. Solution turn of windows firewall and go get AVG firewall from Grisoft.

# January 25, 2008 3:31 PM

SQL Protocols said:

Thanks Ryan for mentioning this. By "virtual servers", do you mean SQL Server virtual server, aka, SQL Server cluster? If that's the case, then I have mentioned the root cause in another blog:http://blogs.msdn.com/sql_protocols/archive/2006/02/27/unable-to-connect-to-a-sql-server-named-instance-on-a-cluster.aspx

# January 29, 2008 1:33 PM

Diego said:

Great post man.

It's a must read.

After following that steps everything was working OK.

# January 30, 2008 5:33 PM

Hui said:

Hi, I tested connection successfully but failed in my code. Error 26 comes back when I debug it.

Could you please look at my connection string?

Thanks!

<connectionStrings>

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="Data Source=localhost\band;Initial Catalog=Players;User ID=test;Password=test"/>

<add name="SqlConnectionString" connectionString="Data Source=localhost\band;Initial Catalog=Players;User ID=test;Password=test"/>

<add name="OdbcConnectionString" connectionString="Driver={MySQL ODBC 3.51 Driver}; server=localhost;database=players;uid=test;pwd=test"/>

<add name="OleDbConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\band\players.mdb"/>

</connectionStrings>

# January 31, 2008 5:03 PM

Wolfgang said:

I experienced these connection problems when SQL-server is not configured with default port. Workaround for this is to add the non-default-port number to the instance-name. e.g. SRV_ABC\INS01, 4321

# February 1, 2008 4:02 AM

Manick said:

Try,

serverName\instance,<tcp-ip port number for the instance>

Good luck

# February 6, 2008 11:16 AM

Arshad said:

What the hell is this :(

I just found that my SQL Express service was stopped automatically, I just restart it and all goes fine now :)

# February 25, 2008 4:30 AM

Mike Bosch said:

I cannot for the life of me get connected to a remote SQL database.  I'm using ReliableSite.NET and they gave me this server/instance but I keep getting the same error 26.  I think the guy is lying to me about the port its using.  Can anyone help!?  I've tried everything I could find and nothing.  I've basically ripped apart my firewall, added all sorts of things.

208.68.171.100\MSSQL4

# March 25, 2008 12:28 AM

David Diener said:

I was unable to create a database project using Visual Studio 2008 Team Suite and SQL Server 2005 Developers Edition SP2.

None of the these solutions worked for me. I finally discovered the solution by configurating the following in Visual Studio:

Tools

Options (check show all settings box)

 Database Tools

  Data Connections

   SQLEXPRESS (remove - leave blank)

  Design-time Validation Database

   [SERVERNAME] (remove - leave blank)

good luck.

# March 30, 2008 2:05 PM

Ashish Sharma said:

I am also facing the same problem again and again. Steps that i have followed are as below

1) I am using windows 2003 server class machine

2) I already have sql server 2000 running on the machine

3) Now i installed sql server developer edition 2005 on the same machine

4) the 2005 instance name is changed so that it doesn't conflict with 2000 instance.

5) TCP/IP port for server and for client both are changed to avoid conflict

6) I made sure that all required services are running fine, i.e. browser, server, agent and also verified that remote connections are on.

7) There is no firewall in question here

8) I just have a doubt regarding UDP port, i am not too sure how to ensure that 1434 is open, can someone guide me to that.

Yeah one more thing i tried with above two servers on windows XP machine, then i was able to get the remote connection for both of the servers.

But in the windows 2003 server machine i am not able to remotely hit sql server 2005, however i can very well hit the sql server 2000 machine.

Any pointers guys.

Thanks,

Ashish

# April 2, 2008 7:45 AM

Adam said:

In order to run sql 2000 (server o msde) it needs to be at SP4. This stops the sql browser service losing it.

The sql 2005 will use dynamic ports, check the surface configuracion manager to see which dynamic port is being used and see if you can telnet directly to that port from  you XP machine.

# April 16, 2008 11:23 AM

Dan Colbert said:

This post is still helping people after almost a year - THANKS LOADS!

Dan

# April 18, 2008 8:54 AM

n0o88o0y said:

Update for windows server 2008 firewall.

# April 18, 2008 3:23 PM

Hector Hernandez said:

thank you. my instance name was incorrect.

# April 19, 2008 3:44 PM

sarab said:

Absolutely useful post. Solved my porblem of connecting to SQL server 2000 through upgrade advisor.

Thanks a lot

Cheers,

Sarab

# April 23, 2008 1:23 AM

Cristian Daini said:

My aspx page works well with Visual Studio 2005, but with Visual Studio 2008 I get the Error 26.

I have Windows 2003 and SQL Server 2005

Thanks, Cristian

# April 26, 2008 8:53 AM

Paul said:

Terrific details....this post has given me great information.

I have this same problem, but only on two of the 8 machines my application is installed on.  This is what is so confusing.  The conenct string is of course identical on all machines.

Any ideas why only specific client PCs may have this problem while others do not?  I just cannot find any configuration differences between a client that works and one that doesn't.

All clients are WinXP SP2....

Thanks, Paul

# April 29, 2008 1:13 PM

SQL Protocols said:

Can you check this blog and see if there is any alias configurated on the specific machines?

http://blogs.msdn.com/sql_protocols/archive/2007/01/07/connection-alias.aspx

Thanks, Xinwei

# April 29, 2008 2:27 PM

Chris Williams said:

Thanks - resolved my issue in an instant very nice and clear explanations

Thanks alot

# May 9, 2008 5:02 AM

Sandeep Verma said:

Thank you so much! I was always thinking that this error is related to "Remote Connections not emabled". Finally found that Sql Browser was disabled at server. Thanks Again!

# May 9, 2008 8:14 PM

Triguna M S said:

I followed all the options except 5th. I want to know how to put UDP and sqlbrowser.exe into exception.

What is the meaning of this?

Please help me in this regard.

Thank you in advance.

Triguna M S

# May 23, 2008 11:54 AM

Triguna M S said:

My event viewer shows this:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

{0C0A3666-30C9-11D0-8F20-00805F2CD064}

to the user MALATHI-TRIGUNA\acer SID (S-1-5-21-1787582532-113898072-582750426-1000) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

# May 23, 2008 11:58 AM

gauri said:

not connecting to the database(SQL server), It shows the error -  SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified.

Kindly give the solution

# June 2, 2008 8:04 AM

Philip Patrick said:

Perfect! Followed those simple steps and was able to find the issue (SQL Browser service was disabled in my case)

Thanks!

# June 4, 2008 9:33 AM

Stay at home mom resource for making extra money online. said:

Join us today as we discuss The Vaccine Book b y Robert W. Sears. This is the second time that contributors of Silicon Valley Moms Blog , Chicago Moms Blog, DC Metro Moms Blog and NYC Moms Blog (along with the rest our friends throughout the blogsphere)

# June 9, 2008 4:04 PM

Meg said:

Just wanted to say thanks.. this helped.. so silly, I has the SQL Browser service stopped and forgot to start it back up again.. the simple checklist helped point that out.

# June 20, 2008 10:02 AM

Diki K said:

Thanks a lot, this solution solved my problem. It turns out that the SQL Browser service wasn't even running. lol.

After I enable the allow remote connections and running the SQL Browser service, everything was okay.

Thank again.

# June 23, 2008 10:39 PM

Navin said:

Hi,

I am writing a login functionality for my asp.net 2.0 website. I used

the Login  wizard control from the visual studio 2005 tool panel and drag it over

to my asp.net webpage. In my development pc, it works without any

error. I noticed that it creates the following in my App_Data folder

ASPNETDB.MDF

aspnetdb_log.ldf

When I migrate the App_Data folder over to the domain page and

test the login feature again, I get the following message. Any help is

greatly appreciated for this beginner.

Thanks for reading my post..

error message:

Server Error in '/' Application.

--------------------------------------------------------------------------------

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:

[SqlException (0x80131904): 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]

  System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131

  System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186

  System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554

  System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114

  System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421

  System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

  System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173

  System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133

  System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30

  System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

  System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

  System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494

  System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

  System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

  System.Data.SqlClient.SqlConnection.Open() +111

  System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84

  System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197

  System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +3629

  System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305

  System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105

  System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453

  System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149

  System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17

  System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

  System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115

  System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163

  System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7

  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

  System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33

  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

webconfig file:

<?xml version="1.0"?>

<!--

   Note: As an alternative to hand editing this file you can use the

   web admin tool to configure settings for your application. Use

   the Website->Asp.Net Configuration option in Visual Studio.

   A full list of settings and comments can be found in

   machine.config.comments usually located in

   \Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

 <appSettings />

 <connectionStrings>

   <remove name="LocalSqlServer" />

 <add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\vhosts\teleaccount.com\httpdocs\App_Data\ASPNETDB.MDF;Integrated Security=false;User Instance=true ; uid= priyajulie ; pwd=priya_julie "/>

 </connectionStrings>

   -->

 <system.web>

   <!-- file:///C:\Users\navibingo20\Documents\Visual Studio 2005\WebSites\jupitel site\Web.sitemap

           Set compilation debug="true" to insert debugging

           symbols into the compiled page. Because this

           affects performance, set this value to true only

           during development.

       -->

   <authorization>

     <allow users="navin" />

   </authorization>

   <roleManager enabled="true" />

   <authentication mode="Forms" />

   <pages enableEventValidation="false" />

   <compilation debug="true" />

   <profile>

     <properties>

       <add name="loginname1" defaultValue="" />

     </properties>

   </profile>

   <!--

           The <authentication> section enables configuration

           of the security authentication mode used by

           ASP.NET to identify an incoming user.

       -->

   <!--

           The <customErrors> section enables configuration

           of what to do if/when an unhandled error occurs

           during the execution of a request. Specifically,

           it enables developers to configure html error pages

           to be displayed in place of a error stack trace.

       <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

           <error statusCode="403" redirect="NoAccess.htm" />

           <error statusCode="404" redirect="FileNotFound.htm" />

       </customErrors>

       -->

<machineKey validationKey="4BFB8F1F6611EA4E4621888B5828003FF5EC98916ABEB3163BD0F29A5B19DD1BF9BACF4CD7F37F0A07378A651DDC77F5AA3BC731E652AE355D02631064803845"

decryptionKey="5951A42B1F6420EDDB8828738FDD8305D94559728BBBF48A" validation="SHA1" />

 </system.web>

</configuration>

is it necessary 4 me to install the sql server Management express edition in my hosting server ??

# June 24, 2008 8:58 AM

ER said:

4) Make sure SQL Browser service is running on the server.

THANK YOU! my browser service was disabled, this fixed it, this was causing me no end of trouble...

# June 24, 2008 3:38 PM

NEHA said:

Hai ,

I had downloaded the sql management studio express and i tried to login ...

Then i got a connect to server dialogbox where i need enter

Server Type  

Server Name

Authentication

Username

Password.

I am using my home machine and its not connected to any other computers.

So how can i find the server name(is it the name of my computer and how can i find its name )..without that i am not able to connect.

i am gettuing this error 26 error location server/instance specified.

wht can i do

pls help meeeeeeeee

# July 11, 2008 11:52 AM

Promo said:

Not all Error 26 is caused by remote things. It could also be the machine.config setting or provider issues. Read this:

http://www.aquesthosting.com/HowTo/Sql2005/SQLError26.aspx

# July 17, 2008 1:55 PM

Wilson said:

I got the same problem before but after I replace the machine name with the actual IP address it works great.

# July 24, 2008 12:18 AM

Bhavesh said:

I tried to connect using ServerName\InstanceName. It gave me error 26.

I tried to connect using ServerName\InstanceName,portNo - It succeed.

After 1/2 hour, This error was automatically resolved and i was able to connect using ServerName\InstanceName again.

Taking Option 3, I suspect it was DNS Issue.

Questions:

1. Where can I get log entry of DNS connection failure?

2. If it was DNS then why it connected using ServerName\InstanceName,portNo ?

I was able to ping the server and also able to remote desktop using servername.

# August 8, 2008 5:30 AM

Bivash said:

Thanks for your help.It really works.

# August 10, 2008 4:27 AM

Mr. DBA said:

David Diener's comment helped me fix a VS 2008 db project creation error.

I realized its not a bug, but a feature, cause we didnt have a LOCAL install of sql on the dev box, something required for the DB pro edition of vs2008

# August 26, 2008 6:07 PM

Arun said:

Hey

Ok this is the problem i am having. I am connecting to the databases using Microsoft Sql server management studio . So i have server A which can connect to a name instance in server B using sql authentication . I use this as a test before i start a windows service from A which connects to B using a connection string . All this works ok as A and B are on the same LAN

however i now have a server C which is excatly the same as A with the exception that its connects to B through a WAN. Once again i use the Microsoft Sql server management studio and it keeps giving me error 26 . i have done all the steps above and Server C can ping Server B . Please advise if there is anything else i can check? . Do i have to add and alias in Server B for server C?

# September 9, 2008 11:17 PM

Xinwei Hong said:

Looks like a firewall on the way between B and C blocks SQL Browser packet (on UDP port 1434). If that's the case, you may have to use alias (should be on C, client machine) or use TCP port # directly.

Thanks.

# September 10, 2008 12:08 AM

Nicolai Willems said:

Hey there, thank you for a great post.

I'm running a Windows 2008 with SQL 2005 and have a Windows 2003 for my sharepoint. I found out that as default the SQL configuration dosn't open up the UDP port discussed. So I opened it up, and voila, it worked. Now my sharepoint server is happy configuring.

Thanks you again

Regards

Nicolai

# September 12, 2008 11:14 PM

Raj said:

Hi,

On my live server, there 3 inserts query one after the other. Firts insert takes place successfully as I have rechecked in db but when I try 2 insert 2nd query I come across this error. Can you help me with it.

I dont think this is an issue with connection string as insert takes place correctly first time.

Any idea wht mkes this erro trigger only at second time??

Thanks in advance

# September 21, 2008 2:48 AM

SQL Protocols said:

Raj, can you post the inserts you are running? Please post a question on the forum I mentioned above. Thanks.

# September 22, 2008 1:36 PM

Mangaiyarkarasi said:

Great Post. We had cluster set up and faced the issue. With this post mentioning about SQL browser, browser service in one of the nodes was not running and when started, things worked out.

# September 23, 2008 5:13 AM

Charles said:

My situation:  SQL2000 and SQL2005 named instances on WinXP x64.  Getting error 26 when trying to create SQL2000 database project using Visual Studio 2008 Team Edition.

Running the SQL 2005 Browser and database.  Added all the services and ports to the firewall, then turned the firewall off and stil getting the problem.  Added the named instances to the hosts file along with the IP addy, to no effect.

Running Spybot (but no error message regarding the failed connection).

Removed the Database Connections and Designtime Database configurations, with no effect.

Noticed that Visual Studio 2008 requires a SQL Server 2005 database instance for performing design time validation (!)

Tried several ways of naming the local SQL 2005 instance as the design-time database, to no effect.

Changed the SQL 2005 instance from the local admin account to my personal domain account (with local admin privileges) to no effect.

Used ".\SQL2005" as the configuration for the design-time database (i.e., ".\{instancename}) and now, finally, I'm able to create the design-time database and load the project !  I note that my company uses certificates for authentication of local machines and domain users on the network.

Why can't MSFT add these directions and steps to a HelpFile and LINK IT to the error message that pops up, instead of giving us the cryptic error 26 message?

# September 25, 2008 7:46 PM

bill said:

Charles:

Networking uses a mail primitive. When you send mail to someone whose address is unknown to the post office, you learn of that fact by the post office returning your mail to you (you see "address unknown"). You might wish that the post office could do more, but obviously could not :).

In other words, error 26 can't provide you the steps to resolve the error, because Microsoft has no idea what has happened, apart from there being an "Error Locating Server/Instance Specified".

You might say "Aha! But my mail recipient can register their new adress with the post office!".

And you would be correct (albeit hopeful). Address forwarding is in essence what the SQL Browser service does, and it relies upon UDP 1434 packets to provide that service. Thus if UDP 1434 is blocked the Browser Service cannot perform address forwarding.

Even address forwaring will not word when you use the wrong name. For example, you appear to have a machine with an instance that is named "<machine_name>\SQL2005", which is not the same name as "<machine_name>" and is not the same name as "SQL2005". The dot is shorthand (a nick name, if you like) for a local machince name, thus ".\SQL2005" worked. But for other clients (on other boxes) to be able to connect to this SQL Server, the name ".\SQL2005" will not work. Instead, those clients will need to use the *complete* SQL Server name, which is "<machine_name>\SQL2005".

Since named instances use dynamic ports, you also need to specify the port (at the client), or you  need to ensure that SQL Browser's (i.e. address forwarding's) UDP 1434 packets can reach those clients.

Finally, "TCP/IP" and "ports" are not Microsoft technologies - they are standards that Microsoft adheres too. I agree they are frustrating to troubleshoot, but those standards are the backbone of the Internet, which makes them very important :).

# October 2, 2008 10:20 PM

freddyccix said:

Well my problem is this error message (error: 26 - Error Loc........)

but:

-can't connect to SqlServer Express 2005 on my network server from my application while ITS RUNNING. What I mean is that when I use Server Explorer Window on VS2008 every thing is fine (I can even insert and modify data from server explorer), in fact, when I use Datatables and I choose to preview data through TableAdapters (Design Time) I get data, and also can run the queries from there directly to the data base, but when I'm debbugin the application I get this error.

-when I run Sql Server Management Studio, its also fine, even though I can't see the Sql instance on the server (or any of my partners machine). But if I type the server path (servername\instance) everything is OK.

-I know the problem is not the connection string 'cause my partners and I use the same one to connect to the server, and no one has this problem.

-also tried to shut down my firewall and the server's also, and nothing.

-ok here are the specs for both, server and client pc:

  SERVER:

*Running Windows Server 2008 64 bits

*Sql Server Express 2005 SP2 x86 (WOW)

  Client:

*Running Windows Vista Ultimate SP1 64 bits

*Sql Server Express 2005 SP2 x86 (WOW)

*Sql server 2008 Enterprise 64 bits

*VS 2008 Team Suite.

  Everyone Else:

*Windows Vista ultimate 32 bits

*Sql Server Express 2005 SP2

So can you help me?? please, I'm working localy only, so is a pain doing this

# October 27, 2008 1:20 PM

bill said:

freddyccix:

Regardless of whether SQL Server (Express) is running or not, error 26's message reveals the service cannot be _found_. When "you" are debugging ("when I'm debbugin the application I get this error"), _where_ is it that your debugging process is running? Are you debugging at a client to SQL Express, or are you debugging locally, on the SQL Express box?

And what do you mean by "I can't see the Sql instance on the server"? Who is "I", and_where_ is "I"? Isn't "I can't see the Sql instance on the server" synonymous to error 26's message?

After attempting to answer my questions (which are aimed at getting you to think about this problem in terms of client/server architecture :)), see the "Neworking Support" section of "SQL Server 2005 Express Edition Overview" (http://msdn.microsoft.com/en-us/library/ms345154.aspx). Then see the other suggestions on this page (such as ensuring the browser service is running).

I see others have asked how to verify whether UDP port 1434 traffic has been filtered: Try Portqry.exe (there are many other such utilities available, also called "port sniffers"). Shutting down "known" firewalls simply means that _unknown_ firewalls are left running.... Similarly, a group policy can be created (by your employer, unknown to you) to block UDP port 1434 traffic (another reason for sniffing ports). You can also inspect the errorlog, to see what port SQL Express is listening upon, and then you can temporarily specify that port within your connection string (as a way to isolate the issue to unknown filtering of UDP port 1434 traffic, should your temporary port-specified connection string succeed).

# October 28, 2008 10:31 PM

bill said:

freddyccix:

Regardless of whether SQL Server (Express) is running or not, error 26's message reveals the service cannot be _found_. When "you" are debugging ("when I'm debbugin the application I get this error"), _where_ is it that your debugging process is running? Are you debugging at a client to SQL Express, or are you debugging locally, on the SQL Express box?

And what do you mean by "I can't see the Sql instance on the server"? Who is "I", and_where_ is "I"? Isn't "I can't see the Sql instance on the server" synonymous to error 26's message?

After attempting to answer my questions (which are aimed at getting you to think about this problem in terms of client/server architecture :)), see the "Neworking Support" section of "SQL Server 2005 Express Edition Overview" (http://msdn.microsoft.com/en-us/library/ms345154.aspx). Then see the other suggestions on this page (such as ensuring the browser service is running).

I see others have asked how to verify whether UDP port 1434 traffic has been filtered: Try Portqry.exe (there are many other such utilities available, also called "port sniffers"). Shutting down "known" firewalls simply means that _unknown_ firewalls are left running.... Similarly, a group policy can be created (by your employer, unknown to you) to block UDP port 1434 traffic (another reason for sniffing ports). You can also inspect the errorlog, to see what port SQL Express is listening upon, and then you can temporarily specify that port within your connection string (as a way to isolate the issue to unknown filtering of UDP port 1434 traffic, should your temporary port-specified connection string succeed).

# October 28, 2008 10:31 PM

Kurt Johnson said:

When I had this issue, I also had to set Hide Instance to No. Somehow, this setting flipped to Yes (or, I did it).

# November 13, 2008 11:13 AM

Toyin Fatuga said:

Thank you so much.  I spent hours trying to figure this out and am glad I found this blog entry.  For me the server/instances was wrongful specified.

Thx.

# November 25, 2008 6:26 AM

noha said:

thanks alot it hepled me specially

run the sqlexpress browser

close the firewall

# December 2, 2008 5:54 AM

Bob said:

Thanks a bunch! saved my bacon.  Very clear explanation and simple instructions.

you are a star.

# December 9, 2008 5:40 AM

Matt said:

Thanks, This is the best solution yet, it really covered more than what most others do.

# December 17, 2008 9:01 PM

Bret said:

Thank you so much for this. You're right; really a simple issue, and yet I totally overlooked the obvious. Once I read the post, I was able to calm down, trace the problem logically, and get it working. Thanks again!

# December 31, 2008 4:59 AM

Nitu said:

Hi

I am using WebPart in VS 2008 and i am getting 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)

i tried everything but not able to resolve the issue

Please help

# January 2, 2009 3:52 AM

Nitu said:

Hi,

I have solved this issue after installing sql server express edition.

many thanks

# January 2, 2009 4:04 AM

Nitu said:

Hi,

I have solved this issue after installing sql server express edition.

many thanks

# January 2, 2009 4:04 AM

Keyur Shah said:

fade up with following error

i installed sql server 2000 and want to connect that from network it gives following error:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

connection string:

<add key="cnstr" value="Data Source=RND\RND;Initial Catalog=GTC;User ID=test;Password=test;Connection Timeout=60;"/>

give me some solution on this

# January 9, 2009 5:15 AM

SQL Protocols said:

Keyur Shah,

Do you already have any SQL 2005 or 2008 instance on your box before you install SQL 2000 instance? If so, you could see this issue and please refer to the following link:

http://support.microsoft.com/default.aspx?scid=kb;en-us;905618

Thanks.

Xinwei

# January 14, 2009 1:01 PM

PatternExon said:

I think step 1 is most important. After 4 hours of searching around - it was a typo in the connection string in my App.Configuration

# January 29, 2009 9:06 AM

Jerry Barrett said:

Hi

I too am struggling with this error on MS Accounting 2008.

I have an SBS2008 server with SQL 2005 Express running with an instance for the trend micro security app and a seperate instance for the apps, called smallbizapps. The server is called alpha.

I have Business Contact Manager connected to a database on the instance alpha\smallbizapps and I want to integrate the Accounting package (one of Microsofts selling points)

When I try to direct the Accounting package to the same instance it refuses to connect with the error 26.

I have tried all manner of \/ permutations, there are no firewalls running, well the windows ones are switched off, no others installed.

I can access the databases from the server side with the SQL 2005 Express manager and checked the surface area configuration for the instance - its both TCP/IP and named pipes.

The SQL Browser is running and has been restarted a number of times. Errrrm, running out of Ideas, this seems to be the last stage in getting these apps working and I'm stumbling

Can anyone help me please.

Regards

Jerry

# February 7, 2009 10:51 AM

Brent said:

I have a vendor trying to connect through vpn to SQL server 2005 clustered database. I have 4 physical machines and 3 database instances. He can connect through 'SQL Server Management Studio' to the default instance but when he tries to connect to the other 2 databases, he gets the following error: "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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server)"

Any suggestions would be helpful?

# February 10, 2009 12:56 PM

Brent said:

according to the DBA, All three SQL instances allow remote connections.

# February 10, 2009 12:58 PM

Xinwei Hong said:

Jerry Barrett,

What do you mean by:

When I try to direct the Accounting package to the same instance it refuses to connect with the error 26.

Are your machines on a domain?

Thanks,

# February 10, 2009 1:12 PM

Xinwei Hong said:

Brent,

Can you check http://blogs.msdn.com/sql_protocols/archive/2006/02/27/unable-to-connect-to-a-sql-server-named-instance-on-a-cluster.aspx

?

Another possiblity is that your VPN blocks the unmatched UDP packets.

Thanks.

# February 10, 2009 1:17 PM

ruIn777 said:

I'm getting this error and am not sure where to start to fix this. everything I use to connect with (i.e. Server Name, Windows Auth., User Name) is given to me by default. I'm just trying to connect to a developmental server on my system right? This is an issue I've recently come across trying to upgrade the 2.0 .NET Framework to 3.5, SQL server 2008, and Visual Studios 2008. I've since then removed most of those but I'm now getting this error. Does anyone have any ideas or is this just a I.D.10.T error?

# February 24, 2009 5:16 PM

Redninja said:

Thank you for posting this my problem was caused by the Win Server 2008 firewall.

# March 6, 2009 3:54 PM

Naveen D. said:

I had no luck trying to connect remotely to my SQL Server 2005 (STD Edition) instances running on XP Professional from Server 2003.

Came across this from Microsoft that solved my problem:

http://support.microsoft.com/kb/914277

The extra step is to Create an exception for SQL Server 2005 in Windows Firewall.

Hope this help

# March 10, 2009 7:45 PM

Vinny said:

I hope I won't forget it next time : 4) Make sure SQL Browser service is running on the server.

I've been looking for a while to get this working...

Thx for the post!

# March 13, 2009 10:33 AM

SharkBait said:

Hi

Here is my situation:

- I have written an app in VB6 (yeah yeah, I know) that uses ADO to connect to SQL Server 2005 Express, but it works!

- I am running Windows XP on my PC

.....

- I have installed the app on another PC, and copied the database (rQ.MDB) onto that PC as well.

- The mentioned error appears.

Question: Do I have to install SQL Server 2005 on every PC that needs to access the database to make it work?

# March 23, 2009 8:00 PM

Kvansh said:

Step5 corrected the condition on my named installation of SQL2008.

# March 24, 2009 4:44 PM

SharkBait said:

Not being a techie myself, how would I go about achieving this? Or are you saying that I have to install SQL Browser onto every PC that will be using the database?

# March 24, 2009 10:05 PM

SQL Protocols said:

SharkBait,

SQL Browser is only needed on a machine with SQL server, not on all client machine. Did you try to disable firewall? Does your case apply to the corner case I mentioned in this blog?

Thanks,

Xinwei

# March 25, 2009 5:55 PM

Jamar said:

I have the default instance installed MSSQLSERVER, the SQL Browser running, and SQL Server running.  I can connect to the SQL Server Management Studio without any problems, but I can't connect to my database from Visual Studio.  The same error 26 is still showing up.  I dont' get it.

# April 12, 2009 10:34 AM

jose said:

after A LOT of hours, some friend found the key... ANTIVIRUS!!! it was the bloddy antivirus and its "hidden" personal firewall... that was it.

# April 21, 2009 12:13 AM

Windows 7 RC1 gets special Features said:

deVbug’ s Blog is powered by Textcube 1. 7. 7:

# April 26, 2009 9:41 PM

JPGarcia said:

I had the same problem and started when installed .NetFramework 2 SP1, after removing it, the problem disapears

# April 28, 2009 2:56 PM

Stu said:

I will have your babies.  Thanks very much!!! :)

# April 29, 2009 10:23 AM

Jor said:

I don't have a sqlbrowser.exe service. How can I install this after sql2000 has been fully installed?

# May 20, 2009 10:44 AM

SQL NooB said:

thnx to this....

my Biggest problem were solved..

# May 22, 2009 7:21 PM

Man On The Way said:

I have 2-node SQL Server 2005 Cluster which configured as Active/Passive mode, let say A node and P node. I already install 1 CRM instance on this cluster before. Now I wanna to install a second 2-node cluster on these...

# May 29, 2009 4:09 AM

Chris Yard said:

I have been using Visual Studio 2005 for some time now and I created a database from with in that with no problems. The problems came when I upgraded to VWD 2008 and SQL Server 2008 Express I am now getting error 26 and like most people here I have spent hours / days looking on the net for some answers, I have posted a thread in forums asp.net and they told me to look here.  I can not do any thing any more with my database that I started up, granted there wasn't alot in there so can start again.

When I try and do the same as I did last time in VS2005 i.e. right click on solution explorer and add a database I get Error 26, when I try and log on to SSMS 2008 I can not select any server name.

Please Help  Thanks

# May 29, 2009 9:24 AM

Chris Yard said:

I have been using Visual Studio 2005 for some time now and I created a database from with in that with no problems. The problems came when I upgraded to VWD 2008 and SQL Server 2008 Express I am now getting error 26 and like most people here I have spent hours / days looking on the net for some answers, I have posted a thread in forums asp.net and they told me to look here.  I can not do any thing any more with my database that I started up, granted there wasn't alot in there so can start again.

When I try and do the same as I did last time in VS2005 i.e. right click on solution explorer and add a database I get Error 26, when I try and log on to SSMS 2008 I can not select any server name.

Please Help  Thanks

# May 29, 2009 9:25 AM

Rajani said:

excellent post, resolved my issue for me. i had beeen completely disabling firewall my sql server connections to work but after your post i made necessary exceptions and enabled firewall. am safer than before :)

# June 3, 2009 8:17 PM

Monica Whittaker said:

Can anyone please help me? I know this should be easy but it just isn't. This is the connection string I have and if you got to the url it shows the error. It keeps telling me it can't connect or find the database and I am getting so frustrated. Any suggestions would be helpful.

<connectionStrings>

   <add name="classifiedsConnection" connectionString="Data Source=.\\SQLEXPRESS;AttachDbFilename= A2LClassifiedsDB.mdf;username=A2LCLASSIFIEDSDB; password=******; Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

 </connectionStrings>

# June 9, 2009 4:55 PM

Amar said:

Xinwei,

I followed the above steps and still not able to connect to SQL Server from my client machine.

Server machine: XP SP3

Server name: S8_SERVER

Client machine: XP SP3

1. Server name is correct.

2. Instance name is correct. ( I am just trying to connect to the SQL Server\Instance using SQL Server Mgmt Express Studio so the connection string is just Servername\InstanceName )

3. Ping the server machine from client and vice versa

4. Server\Instance

- SQL Server Instance is running on the server

- SQL Browser is running on the server

- Tried restarting both and restarted the machine

5. Firewall is off on each machine.

I am still getting error 26 when I try to connect to the server\instance from the client machine.

It happened when our customer's server machine locked up so they restarted their server machine. After rebooting the server machine never were they able to connect to SQL Server from any of the client machines. Therefore, it has to be something on the server thats different now than it was before restarting.

As far as the SQL Server Instance:

- TCP/IP, Mapped Memory, Named Piped are all enabled.

- TCP/IP uses dynamic port and no static port.

Please advise.

Thank you in advance,

Amar

# July 16, 2009 11:00 PM

mayurpatel said:

re: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

pls let me know what is procedure to solve this problem

# July 22, 2009 3:05 PM

Sum said:

I have tried this method and it works for me

go to SQL Server 2005 Surface Area Configuration (found in "C:\Program Files\Microsoft SQL Server\90\Shared\SqlSAC.exe")

Select Surface Area Configuration for Services and Connections, Check the information in Services status if it is stopped then click on start.

# July 30, 2009 6:58 AM

rvp said:

Thanks for this great post!!!!

Cheers

# July 30, 2009 8:20 AM

Darren said:

Hi, I have tried all the above to no avail!!  Am serioulsy about to throw something really heavy at my pc!!!!  If anyone can help i would be most appreciative!!

I am using Visual Web Developer and set up a a few Queries in a gridview to a locally installed Version of SQLEXPRESS 2005.  Worked no probs.

I installed SQL 2008 on the weekend, after detaching the database from 2005.  Uninstalled 2005.  Installed 2008.  Attached the database.

Now, the gridview connects fine in Visual Web Dev.  But as soon as I try it in a browser I get the error: 26.  

I have resintalled 2008 3 times, reinstall IIS, reinstall .NET 3.5.  There are no Firewalls, i've tried the database connection bug for VS. In the software development the connection string is perfect....

Wot am i missing!!!  Please help!!!

# August 10, 2009 1:31 AM

DEVESHA said:

Very strange issue for me (many compliments for the post anyway...):

========

Scenario

========

The OSs

--------

PC #1 - Microsoft Windows XP Pro SP3

PC #2 - Microsoft Windows 7 RC build 7100

The SQL client

--------------

SQL Server Management Studio 2008 (the same on both PCs)

The SQL Servers

---------------

SQL Server 2005 (company's production environment)

SQL Server 2008 (company's development environment)

both have named instances (e.g. SERVERNAME\INSTANCENAME)

The problem

-----------

- When connecting to both SQL Servers (through Microsoft Windows XP Pro SP3) there are no network related issues;

- When connecting ONLY to SQL Server 2008 [development environment] (trough Microsoft Windows 7 RC build 7100) there are no network related issues BUT when trying connnecting to SQL Server 2005 I get the error 26;

Considerations

--------------

- Firewall disabled on both PCs.

- Unable to see if SQL Browser service is running on the server (the environments are protected by SysAdmins...)

- Tried, on Windows Seven PC, using tcp:SERVERNAME\NAMEDINSTANCE and/or np:SERVERNAME\NAMEDINSTANCE but got same error 26

- Ran the portqry.exe on both OSs and both returned IDENTICAL values:

C:\> portqry.exe -n 192.168.X.Y -p UDP -e 1434

Querying target system called:

192.168.X.Y

Attempting to resolve IP address to a name...

IP address resolved to servername.domain.com

querying...

UDP port 1434 (ms-sql-m service): LISTENING or FILTERED

Sending SQL Server query to UDP port 1434...

UDP port 1434 (ms-sql-m service): FILTERED

Question

--------

Are there some hidden network security policies in the Windows Seven OS, related to SSRP UDP packet, which are sent to SQL server (behind the SQL Server Management Studio 2008) whereas portqry does not?

Conclusions

-----------

I exactly know that Windows Seven RC 7100 is only a release candidate version that should NOT used in a production environment... I'll try same tests using the Ultimate 7600.16385 RTM version and then the Windows Server 2008 R2 RTM build 7600.16385 ;-)

See ya!

# August 12, 2009 7:10 AM

DEVESHA said:

SOLVED my strange issue:

the Windows 7 firewall is divided into 3 distinct protection profiles

- domain profile

- private profile

- public profile

I disabled only the public profile, forgetting the other 2 profiles... so in my domain environment the network operations involved by the Windows 7 was partially blocked.

Now, to be extremely precise, I've re-enabled the firewall, then added a specific rule for the domain profile (exclusively in my case because I work in a domain environment) allowing the incoming and the outgoing the network traffic both

- for the UDP ports 1433,1434

and

- for the Microsoft SQL Server Management Studio program.

Everything works fine now!

Cheers ;-)

P.S.: only 1 question is pending: why when connecting ONLY to SQL Server 2008 [development environment] (trough Microsoft Windows 7 RC build 7100) there were NO network related issues? Microsoft mysteries...

# August 12, 2009 9:38 AM

kapptaink said:

I had the errer 26 and tried a lot of things in alot of post to open the DB in SQL Manaegment Studio: This is the string that worked for me:

\\.\pipe\MSSQL$Microsoft##SSEE\sql\query

If it dont work for you open your backup log file and search for:

SQL Server Connection String: Data Source=np:

What followes after that should be the string you need.

# August 12, 2009 12:34 PM

Jim said:

Thanks for documenting this - saved a lot of grief.

# August 15, 2009 11:13 AM

Manoj said:

Thanks! This is really an excellent articles. This tell where to exactly hit.ONSPOT Hats off!!!

# August 21, 2009 6:15 PM

john b said:

Thanks your blog post solved my problem with the 2008 Express on my Vista laptop. I turned off the Firewall and this allowed the SQL Browser to turn on and this fixed the problem.

BTW, is there a way to change the ports on Express 3008?

# September 6, 2009 8:05 AM

master J.Sh said:

When I try opening some of applications recive this error with event ID:26.

—————————————————————————————————————————————————————

Application popup: verclsid.exe - Application Error : The instruction at "0x0006ffa0" referenced memory at "0x000000f1". The memory could not be "written".

Click on OK to terminate the program

Click on CANCEL to debug the program

—————————————————————————————————————————————————————

PLease help me.

# September 10, 2009 11:40 PM

Yogesh said:

Still I am getting same kind of issue

# October 3, 2009 3:00 AM

SQL Protocols said:

Yogesh, Please post a question in the forum mentioned in the blog. Please provide details as much as possible. Thanks.

# October 5, 2009 12:42 PM

Jack said:

Thanks for the article. Added a named SQL Instance to the default instance and did not reboot. SQL Browser was set to disable so I was able to connect to the default but not the named.

# October 6, 2009 9:27 PM

Mick R said:

Is it possible that some other software could have blocked ports (or something like that)?.. I have 3 workstations that we access a local network database on. For some reason, today, my workstation will not connect but the other ones still work fine (so it can't be a setting on the server, right?).

The connection was saved on my SQL management studio so no details have changed, however, I have installed silverlight (dont know why) and my norton antivirus has expired in the last couple of days. Could either of these things changed my configuration such that it would affect my connection?

# October 8, 2009 8:08 PM

Mick R said:

Sorry, forgot to mention, I am getting this error 26 as well, thats why i made this post. It had been connecting fine for years.

# October 9, 2009 2:26 AM

R patel said:

i am new to .net,i am using visual studio2005 for making a website (asp.net),my project was running fine,but one day i ran my registry cleaner and after that sqlserver is not working and giving error 26,in the line where i am opening the connection

(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))

please anyone can help me,i am so stuck with it.

# October 9, 2009 7:16 AM

Nadeem Shehzad said:

I have tried this connection string, and it works fine with sqlexpress 2005 and VS 2008:

Data Source=.\\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=true;

Make sure remote connection, and TCP/IP protocol is enabled

# November 8, 2009 6:08 PM

McGuire said:

This was working, then quit.  <add name="ASPNETDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=true" providerName="System.Data.SqlClient" />

Have been thru all of the points in the article.  My network manager also checked them.  Have tried other configurations such as: adding the path:  connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=c:\inetpub\wwwroot\MyApp\App_Data\ASPNETDB.MDF;Integrated Security=True;User Instance=true"

Have tried using \\ vs\ before server name, creating and using username and password

Been working on this for two days...any other ideas?

# November 10, 2009 11:44 AM

Xinwei said:

McGuire,

Did you try portqry? What did it return?

Thanks,

# November 10, 2009 5:04 PM

Derald said:

First check that windows firewall is not enabled if you are using a Vista or Windows 7 workstation to access the DB Server. I found that even though I had disabled Windows Firewall a long while ago, that somehow (most likely through updates), windows firewall, had been re-enabled.

However, if you desire that windows firewall be enabled, make the exceptions in the configuration.

# November 12, 2009 6:29 AM

Priya said:

Hi friends....

I ve used login control from toolbox i.e drag n drop

And to create user name n password i open the administer website.. it opens n when i go to security tab it shows me an error....

The following message may help in diagnosing the problem: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Can any one find out where i m going wrong...

Thanks

# November 12, 2009 8:47 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker