Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2004
    Location
    Pittsburgh, PA
    Posts
    41

    Unanswered: Connecting to SQL Server through firewall

    I have a simple asp page that queries a database inside our firewall. It works fine from the inside, and only uses port 1433. But if i put it out on our web server it won't connect and tries to use ports 139 and 445. Has anybody ran across this before?

    Thanks,

    John

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Are those ports that you see registered with the firewall to allow traffic? You can explicitly specify the port number in your app connection string.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by JODonnell
    I have a simple asp page that queries a database inside our firewall. It works fine from the inside, and only uses port 1433. But if i put it out on our web server it won't connect and tries to use ports 139 and 445. Has anybody ran across this before?
    You are using Named Pipes instead of TCP/IP for the ODBC connection on the ASP server.

    -PatP

  4. #4
    Join Date
    Feb 2004
    Location
    Pittsburgh, PA
    Posts
    41

    specifying ports

    is that in the connection string like:

    Data Source=172.25.24.30:1433

    or is there some other syntax.

    Thanks again,

    John

  5. #5
    Join Date
    Feb 2004
    Location
    Pittsburgh, PA
    Posts
    41

    Odbc

    Quote Originally Posted by Pat Phelan
    You are using Named Pipes instead of TCP/IP for the ODBC connection on the ASP server.

    -PatP
    Do you still need to do that for a nonDSN connection?

    Thanks Pat,

    John

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    My first guess would be to go to the ASP server, run the SQL Client Configuration to change the default connection type to TCP/IP. I think that should fix you right up.

    -PatP

  7. #7
    Join Date
    Feb 2004
    Location
    Pittsburgh, PA
    Posts
    41

    Thanks

    Thanks for all your help. It was set to named pipes. Does anyone know if that is the default setting? I always thought the machine came up with TCP/IP as default.

    Thanks again.

    John

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Different MDAC, SQL Tool, etc combinations have different defaults, and some applications change the default as part of their installation (for which I'd like to fry the developer that came up with that idea!). I don't know of any way to concretely identify just how this came to be, so I just fix it when it bytes me and move on...

    -PatP

  9. #9
    Join Date
    Aug 2004
    Posts
    2
    I have a similar question. I have installed MSDE 2000 on a Win2k3 Server and everything is working fine with the DB. The MSSQLSERVER servoce has been running for 60 days straight with no issue. MSDE works great. However, I cannot connect to it on port 1433 through the firewall. Using netstat I cannot see that it is not listening on port 1433. I ran the CLICONFG utility and I can see that it has TCP/IP at the top of the list with Named Pipes below it. I have other servers ( Only Win2k servers) with MSDE 200 installed and configured similarily and these servers are listening on port 1433. I looked at the registry settings and they seem OK - nothing out of place.

    The DB is now in a production environment and I cannot bounce the MSSQLSERVER service till the weekend during scheduled maintenance.

    How can I ensure when I stop/start the MSSQLSERVER service that it is listening on port 1433? Would it be wise using CLICONFG to remove Named Pipes (IIS is the only user of the Database) ? I would prefer not to do that as I believe that NP is faster SQLServer and IIS are on the same box.

    Does the version of MDAC have anything to do with this issue?

    --Steve
    Last edited by smcallister; 08-13-04 at 14:36.

  10. #10
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I can't think of any case where Named Pipes would be faster than TCP/IP that would occur in the real world (yes, I know of a way to construct one, but it would never occur naturally).

    You can certainly do as you see fit, but I would recommend using TCP/IP as your default connection type.

    If you've recently applied either sp3a to SQL Server, or sp2 to Server 2k3, they will automajikally block port 1433. Read up on the service packs to determine how you want to configure your machine to accomodate the access that you need.

    -PatP

  11. #11
    Join Date
    Aug 2004
    Posts
    2
    I believe that the problem was that the CLICONFIG was not what I should have been using. There is a SVRNETCN.EXE utility in the C:\Program Files\Microsoft Sql Server\80\Tools\Binn directory that is the program to use. It turns out that the box had no IPC set at all. I added TCP/IP and it won't use the new options till I bounce MSQSQLSERVER service.

    --Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •