?
Solved

Not associated with a trusted SQL Server connection?

Posted on 2004-10-01
6
Medium Priority
?
1,977 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 7

Accepted Solution

by:
FDzjuba earned 375 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

770 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