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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing SQL server over a WAN

Status
Not open for further replies.

dvannoy

MIS
Joined
May 4, 2001
Messages
2,765
Location
US
I am using the below code to access my SQL server via ADO. I can only access the server on my LAN and Not the WAN. is there some way to access this via IP or what.

Thanks

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strCn As String
Dim strAdd As String

strCn = "driver={SQL Server};" & _
"server=server;uid=sa;pwd=;database=data"


Set cn = New ADODB.Connection

With cn
.ConnectionString = strCn
.Provider = "msdasql"
.ConnectionTimeout = 60
.Open strCn
End With



DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
What you have to look at is the speed of the WAN, whether you have connectivity to the SQL Server computer you are trying to connect to (Try Pinging it) and also whether routers/firewalls are blocking any ports that need to be used. Once you have established that these things are Ok, you should be able to do anything on a WAN that you can do on a LAN, except that it will probably be slower (depending on what you are doing)
 
I can ping it fine. and even use terminal server on that same system over the WAN. which ports should I be looking at that might be blocked. does SQL server use other ports then the standard IP ports?

DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Actually, depending on what Network Library you are using, it does different thing. If you are using TCP/IP toc onnect, I know it uses port 1433 by defauly, but I'm not sure if it uses other ports too. If you are using Named Pipes, it uses a variety of ports (i'm not sure which ones). Have you tried SQL Analyzer and/or Enterprise Manger to connect to the SQL Server?
 
when i am using terminal server over the WAN I can use Enterprise manager just fine. Ican browse through the tables etc. I get the problem when trying to run a project over the WAN. DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
I am using named pipes..using TCP IP with port 1433 DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
The fact that you can access it using Terminal Services only proves that the SQL Server is up, b/c when you are using Terminal Services, it's as if you are on the same LAN as the SQL Server (assuming the TS is on the same LAN). I am guessing that you probably have a firewall/router issue.
Check out articles Q287932 and Q269882 on Microsoft's Web Site. Hope this points you in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top