SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 
        
Home       Members    Calendar    Who's On


12»»

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server... Expand / Collapse
Author
Message
Posted Monday, January 28, 2008 1:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 27, 2008 12:37 AM
Points: 4, Visits: 9
Hi

I getting this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection".

My Environment Configuration.

1. Client Machine : Windows 2003 Server X64 bit Edition OS in this machine My VC++ application is running.
2. Server Machine : Windows 2003 Server 32 bit Editon OS in this machine SqlServer2000 SP4 is running.

When i connect my client VC++ application to SqlServer2000 i am getting this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection".

I can able to create DSN(Client Machine) to SqlServer 2000 (Server machine) its created sucessfully and test connection also ok.

Can u tell any body what is problem in my setup and how to resolve this issue

Thanks in Advance.

Regards
Sudhan
Post #448158
Posted Monday, January 28, 2008 6:49 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 01, 2009 9:52 AM
Points: 163, Visits: 710
I usually get this error when I'm connecting to SQL Server using Windows Authentication. When you make your DSN are you using windows authentication, or SQL Server authentication? Also, check out www.connectionstrings.com to make sure your connection string is formatted properly.
Post #448275
Posted Monday, January 28, 2008 7:47 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:17 PM
Points: 12,614, Visits: 8,640
Looks like you're trying to use SQL authentication to a server that's configured for windows authentication only.


Gail Shaw

We walk in the dark places no others will enter
We stand on the bridge and none may pass

Post #448317
Posted Monday, January 28, 2008 11:50 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 27, 2008 12:37 AM
Points: 4, Visits: 9
Thanks For your inforamtion.

Already In my Sql Server i am using Mixed Mode(Sql and Windows Authentication) only. Still i am getting same error.

Please provide solution for me.

Thanks
Sudhan
Post #448697
Posted Tuesday, January 29, 2008 12:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 27, 2008 12:37 AM
Points: 4, Visits: 9
Hi Gail Shaw

My SQLServer 2000 machine registry value for login mode =2

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\LoginMode = 2

Then its SQL and Windows Authentication only, is it right?

But Same setup when i try to connect another machine with SqlServer 2005 there no issues.

I am waiting for your valuable solution for me.

Regards
Sudhan
Post #448706
Posted Tuesday, January 29, 2008 12:47 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:17 PM
Points: 12,614, Visits: 8,640
Can you post the connection string that you're using please?

Dunno about the login mde. Take a look at the properties of the server in enterprise manager and see what its set to.



Gail Shaw

We walk in the dark places no others will enter
We stand on the bridge and none may pass

Post #448710
Posted Tuesday, January 29, 2008 1:05 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, June 21, 2009 10:51 PM
Points: 422, Visits: 538
If the words "Integrated Security" appear in your connection string you've got the wrong connection string for your setup.

Try something along this line:

connectionString="Data Source=dbservername;Initial Catalog=databasename;UID=sqlloginname;PWD=sqlpassword"



Post #448715
Posted Tuesday, January 29, 2008 1:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 27, 2008 12:37 AM
Points: 4, Visits: 9
Here i have mention my connection string

i am using ADO db connection with DSN name,username, password

_RecordsetPtr pRs;
bstrSQLConnect += (LPCTSTR)m_DataSourceName;
bstrSQLConnect += (LPCTSTR)m_UserName;
bstrSQLConnect += (LPCTSTR)m_Password;
pRs->Open(bstrSQL, bstrSQLConnect, adOpenDynamic, adLockReadOnly,adCmdText);

Regards
Sudhan
Post #448726
Posted Tuesday, January 29, 2008 2:02 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:17 PM
Points: 12,614, Visits: 8,640
Could we see the entire connection string please?

Just before you do the pRs->Open, print the connections string to the debug (or similar) and post the result (remving the password of course)



Gail Shaw

We walk in the dark places no others will enter
We stand on the bridge and none may pass

Post #448729
Posted Wednesday, January 30, 2008 4:23 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 26, 2009 3:52 AM
Points: 120, Visits: 202
You will get this error if you are using Windows authentication but the client machine is not logging into the domain (or AD) that the server is on. I have this problem linking over VPN to some client sites - the solution for me (XP client to various different versions of Windows servers running mainly SQL 2K) was to run the windows "Key Manager (probably available somewhere in control panel - but as MS like to move and rename these things all the time I have a shortcut to:

C:\WINDOWS\system32\rundll32.exe keymgr.dll, KRShowKeyMgr

Then you can add a new server to the cached credentials - e.g. click Add then

Server box: name of server e.g. MYSQLSERVER
User name box: domain and name of valid user on MYSQLSERVER e.g. MYDOMAIN\username
Password ... password for that user in that domain

OK that then try connecting and Windows should use those credentials rather than the credentials you used to log into local machine





James Horsley
Workflow Consulting Limited
Post #449743
« Prev Topic | Next Topic »

12»»

Permissions Expand / Collapse