Remote Connection problem - ports

  • Background:

    Internal MS SQL Express with product data.

    External Website linking with AccessDB with dynamic ASP pages to present product data to public.

    MS SQL express has a fixed public IP address (from our range) via a firewall/nat

    Aim:

    ASP script on external website to pull data from MS SQL Express to update website access DB.

    Test:

    Tested connectivity to MS SQL from website - Error 80004005 - SQL Server does not exist or Access denied.

    Tested connectivity to MS SQL from another test site - connection succeeded.

    Conclusion:

    Webhost blocks port 1432 (and others?) outgoing from their servers.

    Question:

    Can I / Should I change the connection port to another?

    Does anyone know how to test which ports are open?

    TIA

  • Not to worry - I've resolved the issue.

    line in script now reads

    DSN="Driver={SQL Server};Server=<PUBLICIP>,443;Database=<DBNAME>;UID=<USERID>;PWD=<PASSWORD>"

    I've used the standalone firewall to open 443 to just our website host IP address and I use a relay (winiprelay) to change 443 to 1433 - I know I could change the listening port in SQL - but this was the quickest way to find an open port:

    The script I used is:

    <%

    serverport = request.querystring("port")

    serverip = "<publicip>," & serverport

    Response.write "Attempt to connect to: " & serverip & "

    " & vbNewline

    Response.flush

    DSN="Driver={SQL Server};Server=" & serverip & ";Database=<DBNAME>;UID=<USERID>;PWD=<PASSWORD>"

    set my_Conn= Server.CreateObject("ADODB.Connection")

    my_Conn.CommandTimeout = 60

    my_Conn.Open DSN

    response.write "Connected Successfully"

    %>

    So by running code via a browser on http://mywebsite/test_conn.asp?port=443 I could test that it worked - change the port=443 to something else to test a different port number. Once you have a working port you can fix the port number in the script and use that for real scripts!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply