Showing posts with label hst. Show all posts
Showing posts with label hst. Show all posts

Wednesday, March 7, 2012

Error connecting to server

Hi all,

I am trying to connect to the server and i got this error:

TITLE: Connect to Server

Cannot connect to HST\SQLEXPRESS.


ADDITIONAL INFORMATION:

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) (Microsoft SQL Server, Error: -1)

BUT when i tried to connect to the server using the name instance (local) or my computer name directly it works.

I have to use this format in the name instance while i am connecting to the server :

computerName/SQLEXPRESS

what is the problem and how can i fix it?

thanks in advance!

hi,

Reta wrote:

TITLE: Connect to Server

Cannot connect to HST\SQLEXPRESS.


BUT when i tried to connect to the server using the name instance (local) or my computer name directly it works.

if you mean, by that, that you can connect to ComputerName or (Local) and not to ComputerName\InstanceName or (Local)\InstanceName, that means you installed a default instance and not a named instance.. is that correct?

regards

|||

what does that mean?

yes, i installed a default instance....

but i did the same installation with another pc which is work fine using local/SQLEXPRESS

Anyway, if i reinstall it with a name instance, will this fix the problem?

and what about the instance name, what should it be?

Thanks

|||

hi,

that means you are trying to connect to an istance that does not exists, the "named instance" ComputerName\SQLExpress.. so just connect to the default instance and use it..

you do not have to uninstall it and reinstall as a default instance to "fix", as there's nothing to fix.. just use the default instance as it is on that machine..

regards

|||

Thanks Andrea... I know that there is nothing to fix

But.. what why i want to use a name instance is that i wrote an SQL program that use a name instance " computerName\SQLEXPREES " in the connection string.. and the program works fine in all pc's that use it except one.. which has the error mentioned here

|||

hi,

on that "failing" pc, you have to modify the connection string to point to the default instance..

as connection string usually are not hard coded, but built on local settings collected from settings files, you usually do not have to modify the application nor to install a new named instance..

regards