Solved

Not associated with a trusted SQL Server connection?

Posted on 2004-10-01
6
1,967 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

777 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