Thursday, March 22, 2012

error: 26 - Error Locating Server/Instance Specified

Hi

I seem to have a quite common problem. I’ve search forums and blogs both on Microsoft and outside but even though I find many people that have similar problems. After migrating from XP to Vista I can’t seem to solve the problem. I can’t seem to get by Windows Form application based on framework 2.0 to connect to my locally stored SQL Server 2005 Express database. The application has not changed and the environment (apart from the operating system) hasn’t changed either. No matter what I try the problem persists.

The thing that confuses me the most is that I within Visual Studio 2005 can preview data in the data sources tab. In my understanding, both uses the same connection string but I find it possible that the user might differ but I don’t understand why is should.

From my point of view (and might of course be wrong) these things should not be the source of the problem:

· The firewall, since that has been turned off

· The connection string, since that actually work when performing a preview data

· The remote settings, since the server and the client is on the same machine

· The SQL Browser, since I tried connecting using a TCP/IP connection with the same results

Possible problems:

· SQL User access, if the user when performing preview is for some reason not the same as when the application runs

· A Vista problem of some sort

I’ve read basically everything I’ve been able to find on the issue but even though the symptoms fit the solutions don’t solve the problem. This problem has been haunting me for weeks now and I’m really out of ideas?

Here is a listing of things I’ve tried without success:

· The remote settings in the SQL Server Surface Area Configuration has been turned on even though I don’t understand to what end since the server and client in this case reside on the same physical machine. However this did allow me to try connections using TCP/IP. I did restart both the services and the computer to be sure.

· Connections using TCP/IP where the connection string supply contain tcp:<ip>,<port>

· Different exceptions in the firewall, both on port level (for UDP and TCP) and on application level (sqlserver.exe and sqlbrowser.exe). The dynamic port setting has was changed during this test to a static port setting.

· A number of variants of the connection strings (e.g. using ./sqlexpress instead of <machine_name>/sqlexpress)

· All the error logs (Event logs, SQL ERRORLOGS and firewall log while it was turned on) have been checked and the only reoccurring message is a warning message from the SQL Browser: The configuration of the AdminConnection\TCP protocol in the SQL instance SQLEXPRESS is not valid.

The server and the client reside on the same machine.

[1] These are the specific CLIENT side settings:
1. Connection string: Data Source=.\SQLEXPRESS;Initial Catalog=Products;Integrated Security=True
2. Full error message: 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)
I can ping the server
3. Client and server reside on the same machine
4. Yes I can ping the machine
5. Haven’t tried
6. SQL Server Management Studio Express works, using Visual Studio 2005 works but the applications built by VS2005 doesn’t work.
7. N/A (Client and server reside on the same machine)
8.
9. No alias used
10. No encryption used.

[2] These are the specific SERVER side settings:
1. SQL Server 2005 Express SP2
2. Se above
3. Protocols enabled Shared Memory, TCPIP and Named Pipes
4. Yes, there are not errors in the ERRORLOG
5. Yes the SQL Browser is enabled and active and must work at least in some aspects since the preview data works
6. Currently running as default: Network Service
7. The firewall is turned off entirely
8. The firewall is turned off entirely

[2a] Visual Studio 2005 Team Edition for Developers

[3]
1. Vista Business
2. No antivirus installed at this point.

Hope for some help.

Regards Malin

Hi again

I've started using connecting via TCP to my old SQL Server Express server residing on a XP machine and suprise, it works perfectly without any problems what so ever! Apart the operating system I really can't find any differences in the settnigs. So my guess is that the problem must be somewhere in between Vista and my SQL server.

So has anybody else had any experience with Vista and SQL Server Express? Any suggestions are welcome!

Regards Malin

No comments:

Post a Comment