Solved

Not associated with a trusted SQL Server connection?

Posted on 2004-10-01
6
1,968 Views
Last Modified: 2012-06-27
I get the following error when trying to connect to my database via an asp page:

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I'm using a DSN which does test successfully, with windows NT authentication.
This is my connection string: "dsn=OrbisSql; database=orbisbdgt;"

I set up a user in sql as well (I may not have done this correctly though) and have tried to use this user in the DSN - when I do that it tells me the user is also not associated with a trusted connection.

I've been searching message boards, microsoft articles - I feel like I've tried everything and it still doesn't work.  Help!

0
Comment
Question by:TWBit
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:AustinSeven
ID: 12200206
You need to specify the userid and password...

server=servername;database=dbname;uid=userLogin;pwd=password


AustinSeven
0
 
LVL 11

Author Comment

by:TWBit
ID: 12200225
Thats the thing-- I've tried putting them in, but I still get the same error.
0
 
LVL 7

Expert Comment

by:FDzjuba
ID: 12200265
in your DNS connection you have Trusted_Connection=yes which will try to log in as the Windows user.

try direct connection

getConnectionString = "Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=" & strDatabase & ";Persist Security Info=False;Integrated Security=SSPI;"
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 7

Accepted Solution

by:
FDzjuba earned 125 total points
ID: 12200342
or like that

objConn.Open "Provider=SQLOLEDB;Data Source=RAJESH;Database=phone;Initial Catalog=phone;User ID=sa;Password=something;"


or try that

Set oServer = Server.CreateObject("SQLDMO.SQLServer")
oServer.Connect "<servername>" , "<username>", "<password>"
0
 
LVL 11

Author Comment

by:TWBit
ID: 12200449
Hmm... I tried both of your suggestons, FDzjuba, still getting the same error...  
By the way, in case you were wondering, I have the Authentication method in the Server properties Security tab set to "SQL Server and Windows".
0
 
LVL 11

Author Comment

by:TWBit
ID: 12201143
Finally - got it to work. All I had to do was restart SQL server.  I also noticed that its not working with the DSN, only with the direct connection in the string, using FDzjub - so I guess that makes you today's lucky winner! Thanks!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question