I try to connect to database Northwind and I get an error while using the Open() method: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
What does it mean?
Printable View
I try to connect to database Northwind and I get an error while using the Open() method: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
What does it mean?
Hello,
I think your sql server is set up so that it only accepts Windows Authentication. You will have to change the LoginMode key under HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlserver\MSSqlServer to a value of 2. Before doing that stop al MSSqlServer services. After changing it restart MSsqlServer.
Yes, you guessed right. I changed that value to 2. Now I get such error (in the same place): Login failed for user 'sa'.
Hi again,
"The default authentication mode for MSDE is Windows Authentication. MSDE installs with a built-in system administrator (SA) user account. However, because SQL Server Authentication is disabled by default, you cannot access the built-in account after a typical installation." this is from http://support.microsoft.com/default...b;en-us;319930. Follow the steps in "Connect to MSDE with SQL Server Authentication" paragraph.
Here is another article that you might find helpful :http://support.microsoft.com/default...b;en-us;322336
Actually it was enough to pass a connection string, that didn`t include a password.
Nevertheless, thanks for your effort
Just Go in SQL SERVER Enterprise Manager. under the logins
Set User Name = sa
and password= sa
then try again. .
I have created my own database,
I set the appriopriate key value (from previous posts) to 2,
I created a user "martinez", that have all possible rights,
and I`m still getting such error:
Someone can help me?Code:"Login failed for user 'martinez'. The user is not associated with a trusted SQL Server connection."
thank you in advance :)
Is the sql server setup to use both windows and sql authentication?
how to check:
Open The SQL Server Enterprise Manager
Start menu > Programs > Microsoft SQL Server > Enterprise Manager)
Expand the tree-control until you can see your server
Right click on the server name and "SQL Server Properties (Configure)" window will open
Select the Security tab
For "Authentication", select "SQL Server and Windows"
Yes, I think that that was a reason, thank you for help :)