Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble Connectiing

 
Adam Smithison
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I try to connect to my database, I get the following error: Login failed for user 'sa'. Does anyone know what is wrong? Is the user name wrong? Is the password wrong? I have been having this problem for a while now and I have no idea why this s happening.

I have SQL Server and Windows Authentication mode selected.
I am using SQL Express 2008.
My username and password is for the database, not my windows login.



Has only one come across this problem before?
Thanks
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Smithison wrote:I have SQL Server and Windows Authentication mode selected.


This is the problem. You aren't using "Windows authentication" in your code (and you can't). You have to configure your SQL Server application to accept connections via TCP/IP.
 
Adam Smithison
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alrighty, so I changed my connection string to:





I am now getting following error:
The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".

- I know SQL server is running because I have a program that is already connected to the database

 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote: You have to configure your SQL Server application to accept connections via TCP/IP.


And when I said that, I didn't mean your Java application. I meant you have to configure SQL Server. It's clear from the error message that you haven't done that.
 
Adam Smithison
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the TCP/IP Properties tab in the Sql Server Congifuration Manager.
Listen all is set to 'Yes', so in the IPALL section :
TCP Dynamic Ports was already set to 58314
I set the TCP Port to 1433.

I turned off my firewall and my anti-virus program.

I dont know what else I would need to do to set up the server to allow this to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic