Solved

Not associated with a trusted SQL Server connection?

Posted on 2004-10-01
6
1,969 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
Industry Leaders: 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!

 
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

739 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