#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    43
    Rep Power
    4

    Trouble creating datasource for SQL Server Express 2008


    I'm trying to verify a new datasource, and it keeps failing to connect. The SQL Server is using Windows Authentication, so I'm entering my Windows username and password, but it won't connect.

    I know I have the correct server name, which let's say is "MSServer", and for username I use my Windows username ("Foo"), and my Windows password ("Bar"). But it doesn't like it.

    I've done the server name and my username both with and without a "machine name\" prefix.

    Since the DB is on my machine, I've also tried "127.0.0.1" as the Server Name and left un/pw blank. That doesn't work, either.

    Am I missing something here?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,240
    Rep Power
    967
    Fairly sure you can't use NTLM authentication with JDBC. You'll have to enable non-NTLM auth on the SQL box.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    43
    Rep Power
    4
    I enabled non-NTLM authentication, created an account for CFServer, and was able to log into SQL Server through Management Studio. But the datasource still won't connect.

    When I enter computerName/SQLServerName for the Server I get a message saying "...The requested instance is either invalid or not running."

    When I enter the SQLServerName, message says "Error establishing socket. Unknown host: SQLServerName."

    When I enter (local), I get a message saying "Error establishing socket. Unknown host: (local)"

    When I enter 127.0.0.1, message says "Error establishing socket to host and port: 127.0.0.1:1433. Reason: Connection refused: connect"

    I don't know why the first is considered invalid, or why the fourth is refusing connection. Am I forgetting something?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    43
    Rep Power
    4
    I think I know what's happening. It looks like port 1433 isn't open on Localhost. I went in start>run>cmd, and typed

    telnet 127.0.0.1 1433

    and the message came back "Could not open connection to the host on port 1433: connect failed."

    I have Windows firewall turned off, so it's not a firewall block. I need to find out how to open port 1433 -- do I need to do this through IIS, or Windows (or something else)?
  8. #5
  9. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,240
    Rep Power
    967
    Check the troubleshoot section of the CF docs. It sounds like maybe you don't have TCP/IP connections enabled? http://goo.gl/bY8RjX
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    43
    Rep Power
    4
    Thanks, that was it - I had to play around with SSE's TCP/IP config before it finally started working. I posted the solution here:
    http://forums.devshed.com/ms-sql-development-95/trying-to-connect-to-sql-server-on-localhost-1433t-958558.html

IMN logo majestic logo threadwatch logo seochat tools logo