4 Replies Latest reply: Oct 19, 2008 12:44 AM by Newsgroup_User RSS

    Connecting to SQL Server in CF8

    kodemonki Community Member
      This is probably more of a SQL Server question than a ColdFusion question, but I'll ask anyway.

      I'm trying to connect a SQL Server 2000 database (name: RSA) on server RSA to CF8 on server Earth. I'm pretty sure I have everything correct on the CF side. Random data source name, 'rsa' as the database, the server IP for the server (I also tried the DSN name), port 1433, and then the username and password. The advanced settings looked good so I left it alone.

      This is my error message:
      Connection verification failed for data source: admi-sql
      java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: 207.148.212.79:1433. Reason: Connection refused: connect
      The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: my_server_ip_address:1433. Reason: Connection refused: connect

      I am using the MS SQL Server driver.

      Perhaps I'm using the wrong port? How would I find the correct port? I know the database is running and I've been able to connect to it on the RSA server with the username and password I'm using on Earth.

      Any thoughts?

      Thanks in advance!
        • 1. Re: Connecting to SQL Server in CF8
          Newsgroup_User Community Member
          kodemonki wrote:
          >
          > Perhaps I'm using the wrong port? How would I find the correct port? I know
          > the database is running and I've been able to connect to it on the RSA server
          > with the username and password I'm using on Earth.
          >
          > Any thoughts?
          >


          That would sure be the first thing to check out.

          Make sure you can ping that ip address and that port on that address.
          If that server is not responding to remote requests on that port then
          nothing you do on the CF side is going to matter.

          If you can ping those then we have to investigate further. If you can
          not, you need to contact the people who maintain that server and find
          out what (if anything) you should use to connect to it. They may have
          configured it to use another port to make it less vulnerable. They may
          have it locked down to not talk to anybody remotely, but then that would
          be a very lonely database server.
          • 2. Re: Connecting to SQL Server in CF8
            kodemonki Community Member
            I can definitely ping to that port.

            Some additional information: these are my company's servers so I have almost complete control over them.
            • 3. Re: Connecting to SQL Server in CF8
              Newsgroup_User Community Member
              kodemonki wrote:
              > I can definitely ping to that port.
              >
              > Some additional information: these are my company's servers so I have almost complete control over them.

              Can you connect to the database with some other remote tool such as
              enterprise manager? Are the settings used there the same as what was
              provided in the CF admin?
              • 4. Re: Connecting to SQL Server in CF8
                Newsgroup_User Community Member
                kodemonki wrote:

                > This is my error message:
                > Connection verification failed for data source: admi-sql
                > java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing
                > socket to host and port: 207.148.212.79:1433. Reason: Connection refused:
                > connect

                does your sql server box allow sql user connections? the authentication should
                be setup to allow for both windows & sql authentication. and of course the cf
                dsn user should be a sql user.