Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Login failed for user '(null)'. Reason: Not associ

Author  Topic 

perels
Starting Member

23 Posts

Posted - 2008-01-27 : 19:03:52
Hi everybody,

I get the famous "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)" - usually I don't have any problems fixing it, but this time it does not work.

I am trying to connect to a remote server from my client using SSMS.

Here's my setup:

Client 1:
Windows Vista 64bit.
SQL Server 2005
SSMS (SQL Server Management Studio)

Server:
Windows Server Standard 2003
SQL Server Standard 2000

Logon:
Using Windows Authentication on Server over TCP/IP.


What I have done so trying to make it work:

Client 1:
- Added the Username+Password of remote server, to my local Stored Usernames and Password, via User Accounts in Control Panel.
- Added the Server name, port, protocol to Aliases in SCM (SQL Server Configuration Manager).
- Enabled TCP/IP in Client Protocols in SCM
- Verified username and password
- double checked everything at least 10 times now (doh)

In server:
- Enabled TCP/IP as protocol in Server Network Utility of SQL Server 2000.

I have tried to connect directly via IP (i.e. 123.123.123.123,1433) instead of using Server name - no luck either.
I have tried to add Server name to hosts file in Windows\System32\drivers\etc - no luck.
I have tried to add Username+Password to Stored Usernames and Passwords for an IP-address instead of using Server name - no luck either.
I have tried to user name in the following formats: SERVER\Username, Username@SERVER and just Username - no luck.
I have tried with a really lame username and password (for a new account) - no luck either.
I have googled for hours and hours - this is my 10th hour now - no luck :(
I have tried enable SQL Authentication - this works, but it is not an option for security reasons.
I have tried to connect using osql


osql -S <Servername here> -E

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
[SQL Native Client]TCP Provider: An existing connection was forcibly closed by
the remote host.
[SQL Native Client]Communication link failure


Now, what is really strange is that I can connect to the Server using another client pc with the following setup:

Client 2.
Windows XP Professional SP2
SQL Server 2000 Developer
Enterprise Manager / QA - both works fine


And what is even more strange is that I have another Server running with exactly the same specs, which I can connect to both from Client 1 and Client 2 without problems.

I suspect that Client 1 has cached wrong credentials to the first Server (if that is the case, how can I delete them?). I have tried almost every possible solution I can come up with, but no... I am hoping some of you guys can troubleshoot??

Best regards,
Per

perels
Starting Member

23 Posts

Posted - 2008-01-27 : 20:42:33
I have found the solution:

If you're using Windows auth., and the username on your server is Administrator and password is 123, just change your local password for the Administrator-account to 123. Then connect to remote server, while logged in as Administrator on your local pc. And you will be fine.
The username+password combo you are logged on with on your local machine, must be present on remote machine - eventhough you're not working in a domain.
Any username+password combo will work, as long as the same username+password is present at server.

I think this is a bug in Windows Vista with the Stored Usernames and Passwords.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-27 : 21:06:05
Looks like they are not in domain. That's expected if so.
Go to Top of Page

perels
Starting Member

23 Posts

Posted - 2008-01-27 : 21:12:24
Exactly - they are not in domain - but I believe that SSMS is supposed to make use of Windows Stored Usernames and Passwords - which it does not.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-27 : 22:38:13
No such thing. For windows authentication, sql uses current windows account for connection and that account should be valid sql login.
Go to Top of Page

perels
Starting Member

23 Posts

Posted - 2008-01-28 : 04:35:50
Hi rmiao,

I disagree with you - at least a little bit - for the following reasons:

The server I can successfully connect to, only allows connecting if I have entered correct user+password in Stored Usernames and Passwords. So for this server it actually uses the stored user+password - if I delete the stored user+pass, it will not connect.
On the other server it does not seem to matter (it is always using the local login credentials) - why that is, I truly don't know - I suspect it is a bug.
- there have previously been a similar bug on Windows XP, but I don't remember the KB.
Go to Top of Page

perels
Starting Member

23 Posts

Posted - 2008-01-28 : 04:45:36
I am not the only having this problem;

[url]http://help.lockergnome.com/vista/Stored-user-passwords-BROKEN-Vista-ftopict38807.html[/url]

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-28 : 21:12:55
What do you mean 'Stored Usernames and Passwords'? Are they domain accounts? Are they valid sql logins?
Go to Top of Page

perels
Starting Member

23 Posts

Posted - 2008-01-29 : 03:15:29
Stored usernames and passwords are found in Control Panel | User Accounts | "Manage your network passwords". Yes, I am using valid logins for SQL server.

Stored usernames and passwords is also the place where other passwords to other networked computers are stored, for example Remote Desktop.
Go to Top of Page

bhaskarareddy
Starting Member

7 Posts

Posted - 2012-07-05 : 22:35:34
hi

it may help you to get the solutions

http://csharpektroncmssql.blogspot.in/2012/07/login-failed-for-user-sa-in-sql-server.html[url][/url]
Go to Top of Page
   

- Advertisement -