Monday, February 20, 2012

Remote connection problems

I have a Windows 2003 server running SQL Server 2005. I can connect locally via TCP/IP and I've followed all the recommended steps to enable TCP/IP and remote connections.

However, I cannot connect remotely from my desktop machine (different LAN) using the SQL Management Studio, not will the same connection string work on a webserver that's on a different machine.

My connection string is:

Dim objConn, objRS, strConn, strSQL, Email_Number, Template
strConn = "Driver={SQL Server};Server=88.208.229.121;Database=test;Uid=XXX;Pwd=YYY;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConn

The error that I'm getting on the client with management studio is that the remote database is not available and most probably because TCP/IP was not enabled!

The error that I'm getting through classic ASP on the remote web is:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

Keep in mind I can use the exact same connection string and ASP and connect on the local machine, no problems.

Any help in this matter will be greatly appreciated.

Thanks
Riaan
London

Is there a firewall (esp. Windows firewall) between your computer and the server?

Have you enabled remote connections (using the Surface Configuration tool)?

Have you enabled TCP/IP?

Check these resources:

Configuration -Configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

Configuration -Connect to SQL Express from "downlevel clients"
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx

|||Hi

There is no firewall on the server, and from this location I connect through a broadband router that has the standard type of protection.

Yes, remote connections and TCP/IP are enabled.

I actually followed the steps from the first article.

Riaan|||I've done every step in the mentioned articles as above and neither of my two web servers at my ISP are running Windows Firewall. They are both at the same ISP and as I said, with the connection string I use I can browse the DB from classic ASP on the server that runs SQL, but not from another server that just runs IIS.

Is there anywhere else I should look?

Riaan
London|||

I noticed that your server bridges two networks.

It is possible that the problem lies there due to the added complexity involved in dealing with two networks simultaneously.

It will have two ip addresses, one for network 1 and another for network 2. You cannot connect to the network 1 ip from network 2. From your local machine you can "see" both networks and both network cards, so it will be able to connect to either ip address. Only remotely does it matter which identifier you use for your server (assuming that the configuration of your server is absolutely perfect) because again the server bridges two networks. So have you tried the other ip address to make sure you aren't using network 1's ip address to try to access the server from network 2?

Additionally, you will have to make sure that you have enabled it for both network interfaces -- this requirement is there to allow differentiation between trusted and untrusted networks but of course adds to the complexity of configuring the system to service two different networks.

I hope this helps,

John Gordon (MSFT)

No comments:

Post a Comment