TWBit
asked on
Not associated with a trusted SQL Server connection?
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!
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!
ASKER
Thats the thing-- I've tried putting them in, but I still get the same error.
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;"
try direct connection
getConnectionString = "Provider=SQLOLEDB;Data Source=MyServer;Initial Catalog=" & strDatabase & ";Persist Security Info=False;Integrated Security=SSPI;"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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".
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".
ASKER
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!
server=servername;database
AustinSeven