.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Login failed for user 'sa' .The user is not assosiated with a trusted SQL Server Connection.

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Dear Friends,

                   I have downloaded a project from



 ,which is an example of 3 tier architecture.

To run this project the author has suggested to change the 'value' in <appsettings> of webconfig file.

previously it was

 <add key="SqlConnect" value="ABRAHAMOS;database=TimeManagement;uid=sa;pwd=moses;" />

I changed it to

 <add key="SqlConnect" value="server=ABC-314FF72122C\SQLEXPRESS;database=TimeManagement;uid=sa;pwd=moses" />

as 'ABC-314FF72122C\SQLEXPRESS'  is the server name of my sqlserver 2005.

when i run the project and try to enter something from a page then error occur as  'Login failed for user 'sa' .The user is not assosiated with a trusted SQL Server Connection.'

what could be the possible reason?????????


Till now I have tried following things:

1. I kept the pwd value blank and tried to run-------- then also the same problem

2.   I kept the pwd value .(dot) and tried to run-------- then also the same problem

3.   I tried to chan

View Complete Post

More Related Resource Links

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.


I have been using my workstation on a Windows 2000 SQL Server network for several weeks without any issues. I am using Activant Prophet 21 accounting software along with MS Office 2010 Professional on a Windows 7 Ultimate platform. I recently upgraded to the new Windows Live. While working with Access today, I suddenly lost connection to the server (also my internet server). I received the following message:

Unable to connect
SQLSTATE = 42000
Microsoft OLE DB Provider for SQL Server
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Potential Reasons:

1. Invalid User Name 

2. Invalid Password

3. Invalid Server Name

4. Invalid Database Name

 Any suggestions?

P.S. I am able to access the SQL Server using my user name from a different (Window XP) workstation (i.e. database functions and internet access)


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

First at all, My name is Yuri.
I have a problem with SQL server 2005 when I want to select data from sql server database on another machine and then insert data to local sql server 2005 database. And I Have checked that authentication mode for both sql server database is mixed mode.
If anybody can give suggestion for my problem, many thanks before.

Best Regards,


Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.


I am receiving the following message when connecting via query analzyer to SQL server using windows authentication.(error 18452). I have a login created with the sys admin server role on the server. When I connect using SQL authentication it works.

I added myself to the local admin group on the server, this allows it to work. The same situation is seen with another user.

I am using windows 2000 sp4 server and SQL 2000 SP3, connecting from NT4. I get the same issue if I use TCP or named pipes. We have been using SQL security but are moving to windows authentication - but this issue is stopping us.

I have checked and upgraded my version of MDAC to match the server version 2.7 (sp1)

Any help would be much appreciated.



Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.


I have two SQL 2000 Server. Both server needs to communicate with each other. The setup was working for last 8 month. Last week, we disconnected the server 2 from the network and then we reconnected the server 2 again. Now when we tried to call StoredProcedure of Server 2 from Server 1 we get the following error:

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

This used to work.

However if we call storedprocedure of server 1 from server 2, it works just fine.

This is an old problem and this problem has been answered several times. The problem is none of them are working for me.

The main solution that has proposed is that I should set login option to Mixed Mode. My authentication mode has been set to mixed mode, I have also checked the registry and that's ok too. What I can't get what used to work and now it doesn't.


I am completely lost.

Login Failed for User "XXX" when login from a ETL machine for Sql Server 2005 SP2

Hi Guys, I have a straange issue with Login Failed errors coming intermittently probabaly twice in a week: I have a  production Database on Server A and we have Two ETL servers on Server B and Server C. Sometimes when the ETL's (SSIS) run from SERVER B I do get an error stating login failed for user "XXX" this user is a sql server user. And when I run the same package from Server C it does not give any error and runs smoothly. Both the packages uses the same configuration file to connect to the same database with the same user credentials. Also this error is not a frequent error but comes along once or twice in a weeK. Can anyone shed some light on this and let me know the root cause. Both servers have the same sql client version as well. All servers mentioned above are 64 bit windows 2003 servers. Raju

SQL Server 2005 "Login failed for user" sa

I have not been able to install SQL Express SP2 (standard or advanced) on Vista Ultimate (RTM). Every time I try to install, I get the following error message: SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'. Refer to server error logs and setup logs for more information. When I check the logs, the only information I can find that is at all useful is: Doing Action: Do_sqlScriptPerfTime Start: Do_sqlScript : Thu Mar 01 21:35:42 2007Service MSSQL$SQLEXPRESS with parameters '-m SqlSetup -Q -qSQL_Latin1_General_CP1_CI_AS -T4022 -T3659 -T3610 -T4010' is being started at Thu Mar 01 21:35:42 2007SQL service MSSQL$SQLEXPRESS started successfully waiting for SQL service to accept client connectionsService MSSQL$SQLEXPRESS started at Thu Mar 01 21:35:48 2007SQL_ERROR (-1) in OdbcConnection::connectsqlstate=28000, level=-1, state=-1, native_error=18456, msg=[Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'.         Error Code: 0x80074818 (18456)Windows Error Text:   Source File Name: lib\odbc_connection.cppCompiler Timestamp: Wed Jun 14 16:28:15 2006     Function Name: OdbcConnection::connect@connectSource Line Number: 148 Has anyone else run into this issue and resolved it? I have seen posts for earlier versions of SQL Express that said to run

Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authenti


Under a network service account. I want to perform some operations on the SQL server DB.

I am passing the user id and password of the admin on that box. Still I am getting Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authentication.

Is there any way i can connect to Sql server with user id and password?

Connection string i am using is Data Source=imdbstrs22;Initial Catalog=DataStore;Integrated Security=false;user Id=XXX;password =Imdbaug#10;





Login failed for user: Reason:Token-based server access validation failed with an infrastructure err



I have installed a named instance of SQL Server 2008 R2 Enterprise 64 bit on Windows Server 2008 R2 Enterprise 64 bit. The os is running as a VM ware virtual machine.

I have created an AD security group for database engine sys admins on that machine. I added my user to that group.So for example;

domainname\machinename_SQL_DBE_SysADmins is a user with SysAdmin server role permissions. User domainname\MichaelEFF is a member of this group.

When I log onto the machine as this user and run the management studio with run as administrator I cannot log into the database engine. The log shows the error:

Login failed for user: Reason:Token-based server access validation failed with an infrastructure error

I've read many posts where the MVP says that the UAC is not passing the group membership. Is this the case? If so then how will role based access ever be possible with windows authentication? How can this be resolved?




Login failed for user:Token-based server access validation failed with an infrastructure error


I would appreciate help with the following issue:


I have created a local group in our SQL 2008 server and added two Windows user accounts "DOMAIN\UserName"  I  then added the local group to the database and granted read only access.


The users are trying to link tables using MS Access using and ODBC connection and getting the following error.

Users are not system administrators.


Date                      6/30/2010 1:01:54 PM

Log                         SQ

SQL Server: Login failed for user: '\$'



I hate to be the 12345th person to request assistance on this topic, but despite looking at previous requests, I can't seem to find the solution. Any assistance you could offer would be much appreciated.


I have a new ASP.NET 2.0 web application which is hosted on (for argument's sake) WEBSERVER (using IIS 6.0), and which accesses data on SQLSERVER (using SQL Server 2000).

Because this is an intranet application, I want the application's authentication mode to be Windows, and the IIS authentication mode to be Integrated Windows (with Anonymous access disabled). ie: IIS should authenticate the user as smithjohn and SQLSERVER should also authenticate the user as smithjohn.

I don't know if this is relevant, but because of an existing nasty Windows application, all relevant domain users already have their own <DOMAIN>\<username> User account on SQLSERVER.


When I build and browse the pages in Visual Web Developer Express, I can retrieve information from SQLSERVER without any problems.

When I publish the site, and upload it to WEBSERVER, I get the following error upon attempting to retrieve data from a stored procedure on SQLSERVER:


Cannot create a connection to data source ... Login failed for user: BUT not for all reports!


SQL Server 2008 using Report Builder v2.0  (Microsoft SQL Server Reporting Services Version 10.0.2531.0)

We have several reporting service apps with many reports in each one. There is a set of 4 reports that all report on similar info (but grouped differently) that can be run by me and other network administrators but not any "regular" users. On these reports only, they are getting "Cannot create a connection to data source ... Login failed for user...". As I've said there are other reports that regular users can run just fine!? ALL reports use the same Shared Connection Data Source on the server that is set up as Windows Integrated Security. The Data Source's Security allows Domain Users to browse.  

I've uploaded a test report to SSRS whos SQL is "SELECT 'test' as testField" and that's it: and is connected to this same Data Source and users still get the Login Failed error... even tried creating and using a new Data Source that points to the same SQL Server DB to no avail. Examining the rdl's XML doesn't reveal anything either.

Reporting Server is a different machine than the SQL Server DB holding the data.

The only clue is that working reports were created a year before now.

Login failed for user sa Microsoft Sql Server 18456


Its unbelievebale that I am not able to login using my sa password .I am setting it by loggin into windows mode still it is giving error

Login failed for user sa Microsoft Sql Server 18456



Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456, Severity: 14, State: 1) When I us


When I use the following setting to connect server, it succeeds
Server type: Database Engine
Server name: Home-PC
Authentication: Windows Authentication

User name: Home-PC\John

However, when I try to use the following setting to connect the same server, it fails as always
Server type: Database Engine
Server name: Home-PC
Authentication: SQL Server Authentication 

The Error Message as follows
TITLE: Connect to Server
Cannot connect to Home-PC.
Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

Then, I enter the server to change some

Login failed for user '...\ASPNET' only with parameterized query using SQL Server Authentication


Hi there,

I've narrowed the problem down to the following:

  • Receive "Login failed" for user ASPNET error message
  • SQL Server 2005 is db and IIS is web server (both on same computer)
  • Mixed authentication used on SQL Server
  • I have created user ASPLogin with password that is correctly typed int the web.config:


add name="masterConnectionString" connectionString="Data Source=computername\GMOSERVER;Initial Catalog=Portal;Persist Security Info=True;User ID=ASPLogin;Password=password<

Linked server fails -Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. with SQL2008R2


Hi, Kerberos seems to be malfunctioning with SQL2008R2.


I have a new dev SQL2008R2 server called BDSDEV2 and an upgraded(in-place) SQL2008R2 server BDSTEST2.

From BDSDEV2 , I can successfully issue a linked server query to BDSTEST2

select * from bdstest2.eis_prod.dbo.wcs_agent


But from my client in SSMS, connected to BDSDEV2  , the double hop is failing to BDSTEST2 for same query 

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.


I have another BDSDEV1 server, which is SQL2008 and there double hop IS WORKING

From my client in SSMS, connected to BDSDEV1  ,I can successfully issue the query to BDSTEST2 .


The service accounts  for MSSQLSERVER are both local admins on their servers and sa's

I have confirmed SPN is OK 

This is from BDSDEV2 - sql2008r2 server.

C:\Program Files (x86)\Resource Kit>setspn -L tsqlssvc

Registered ServicePrincipalNames for CN=TSQLSSVC,OU=SvcAcct,DC=corp,DC=saif,DC=c


Login failed for user IIS APPPOOL\DefaultAppPool


Any Ideas on how to fix this issue?

Visual Studio 2005, Windows 7 64bit, SQL Server 2005 Express

Cannot open database "sql2" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.

System.Data.SqlClient.SqlException: Login failed for user . Reason: The account is disable


Hi All,

Thank you for advance.

I created a widows service for mail schedule with c#.net and sql server 2005 and it is working fine for past one year.

now sometimes i am getting the "System.Data.SqlClient.SqlException: Login failed for user '<UserName>'. Reason: The account is disabled." error.

then i restarted the windows service manually and working.

what is the problem in my sql server connection and how to fix that issue?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend