Results 1 to 16 of 16
- 02-10-2010, 07:16 AM #1
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
SQL server 2005 - Login failed message
Hi All, could you please help me ?
I'm trying to connect to SQL server 2005 express edition but I've got this error message:
Login failed for user 'PC346519167106\Patricia e Pierre'. The user is not associated with a trusted SQL Server connection.
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'PC346519167106\Patricia e Pierre'. The user is not associated with a trusted SQL Server connection.
at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF (Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unkno wn Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.s endLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l ogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.a ccess$000(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$L ogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Un known Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.e xecuteCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l oginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBCON.main(DBCON.java:32)
I'm using on SQL server 'window authentication' to connect and when I start my PC I'm using a 'PC administrator' user.
Where in SQL server can I manage users accounts ?
Thanks a lot guys !
Pierre.
- 02-10-2010, 07:54 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Sounds like a question for an MS forum.
- 02-10-2010, 09:11 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Have you got Management Studio Express?
Create a user through that, and give it whatever privileges it needs to work with the db you want it to.
I have never used windows authentication to connect. I've always had a "proper" user.
- 02-10-2010, 09:24 AM #4
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
- 02-10-2010, 10:01 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Right click on the security bit in the object explorer on the left and choose New->Login.
- 02-10-2010, 10:05 AM #6
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
Thanks again man !!!
Well, I've just created a new user with all grants.....but I still have this error message:
Login failed for user 'pbaudru'. The user is not associated with a trusted SQL Server connection.
(Microsoft SQL Server, error: 18452)
How can I avoid this please ?
Something still need to be donne on login configuration ?
Regards. Pierre.
- 02-10-2010, 10:15 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Forgot this bit...
Though that doesn't explain why you got that error the first time, unless your connection string in your code was such that it thought you were using a login rather than win-auth.
- 02-10-2010, 10:33 AM #8
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
Thanks man,
I changed to 'mixed mode', but still have a similar error. Note that the 'The user is not associated with a trusted SQL Server connection.(Microsoft SQL Server, error: 18452)' is not in the message anymore....
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'pbaudru'.
at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF (Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unkno wn Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.s endLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l ogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.a ccess$000(Unknown Source)Login failed for user 'pbaudru'.
at com.microsoft.sqlserver.jdbc.SQLServerConnection$L ogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Un known Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.e xecuteCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l oginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBCON.main(DBCON.java:28)
I logged in SQL server with the pbaudru user this time....or do I need to login with the windows login ?
Here is part of code I'm using:
String connectionString = "jdbc:sqlserver://localhost;database=eureka;user=pbaudru;"
+ "password='testlogin'";
conn = DriverManager.getConnection(connectionString);
Regards. Pierre.Last edited by pbaudru; 02-10-2010 at 10:35 AM.
- 02-10-2010, 10:34 AM #9
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
That means that either the user doesn't exist or you used the wrong password.
Edit: I mean, you do, normally, know what "login failed" means, don't you?
- 02-10-2010, 10:43 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Can you login to the management console with that user (rather than win-auth)?
- 02-10-2010, 10:44 AM #11
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
- 02-10-2010, 10:45 AM #12
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
- 02-10-2010, 10:55 AM #13
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Then your connection in Java is wrong somehow.
Typo, something.
In fact, remove the single quotes around the password....
- 02-10-2010, 10:57 AM #14
Member
- Join Date
- Jan 2010
- Location
- Athus - Belgium
- Posts
- 23
- Rep Power
- 0
- 02-10-2010, 10:59 AM #15
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
- 02-10-2010, 11:03 AM #16
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Well look at your connection code and think about what you've entered there. What, just might, be the problem. Change that and try again. It takes 10 seconds. Instead you post again on a site, what until someone happens to see it, and feels like answering, and you happen to see that it has been answered, and then do that anyway, if anyone was "kind" enough to point out the mistakes that should be, at least somewhat, obvious. Which, of course, all takes alot longer.
IOW, use a little initiative and use that thing on your neck for something other than keeping your feet from floating away.
Similar Threads
-
Connect to SQL server 2005
By comp in forum JDBCReplies: 1Last Post: 03-25-2009, 11:25 PM -
hibernate support for sql-server 2005
By javadev in forum JDBCReplies: 2Last Post: 06-25-2008, 01:48 PM -
Having problem in connecting with SQL Server 2005
By rmaadil in forum JDBCReplies: 4Last Post: 05-21-2008, 06:55 AM -
Java connecting to sql server 2005
By pelegk2 in forum JDBCReplies: 0Last Post: 04-05-2008, 09:17 PM -
SQL Server 2005 Jdbc connection
By mgt83 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-27-2007, 04:52 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks