Login failed for user ''. The user is not associated with a trusted SQL Server connection.

image Eugh. Was working with SQL Express today and I was trying to get a Trusted Connection with Windows Authentication (no passwords) working and the TCP/IP connection method failed but Named Pipes worked!?  The weird part was, both connection methods for trusted connections worked on my other servers, so I was pretty stumped and wasn't sure what the problem was...

After taking a look at the Windows Accounts and comparing settings side by side from a working server, I found that the account I was using still had "User must change password at next logon" checked on the machine that kept failing.  So, I unchecked "User must change password at next logon" for the Windows Account that I was trying to use and trusted connections started working again! evilgrin0040.gif


Beware, if you are using Windows Authentication, all Windows Accounts you intend to use must have "User must change password at next logon" unchecked or you will most likely run into this message.  Also, take note, by default, when you create a new windows account, "User must change password at next logon" is set by default.

As a side note, if you are attempting to use SQL Authentication (using "UserName/Password" pair) and the server is set to Windows Authentication only, you'll also receive an error message like the one above.  If your intent is to use a UserName and Password for your SQL Login, then make sure you set your SQL Server to use "SQL Authentication and Windows Authentication".

Boy, talk about descriptive error messages.  The Event Log didn't have any information about invalid password polices... confused0071.gif