Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting to sql server using ip address

Status
Not open for further replies.

steve1rm

Programmer
Aug 26, 2006
255
GB
Hello,

I am trying to connect to a sql server 2005.

Under the surface server configuration - remote connections i have set it for named pipes and tcp/ip. Is there something else i should do with the configuration?

I have also turned of the firewall, in case that has caused a problem.

my connection string is below.

Code:
Try
cnn.ConnectionString = "data source=1.1.1.1,1433\ssd01;Network Library=DBMSSOCN;database=serviceAcc; user id=; pwd=;persist security info=True; encrypt=yes"

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try


I have changed this a few time and the 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

Thanks in advance,

Steve
 
You can connect to a server by specifying the ip address and port combination OR by using the instance name (not both).

"data source=1.1.1.1,1433\ssd01;etc....

Should be:

data source=1.1.1.1,1433

Or

data source=ComputerName\InstanceName



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Also, have you verified that SQL Server is indeed using the port you specified in your string? Paranoid DBAs have a tendancy to change those from the default 1433.



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top