Solved

Not associated with a trusted SQL Server connection?

Posted on 2004-10-01
6
1,966 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server 2012 HA Cluster, Utility Controller No Data 11 59
Determine next b-weekly date 12 56
Complex SQL 10 33
Sql query for filter 12 22
Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now