• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7065
  • Last Modified:

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 connect

I used the follow string connections:
strConnect = "Driver={SQL Server}; Persist Security Info=False; Server=SERVER NAME; Database=DB NAME; Trusted_Connection=Yes;"
AND
strConnect = "Driver={SQL Server}; Server=SERVER NAME; Database=DB NAME; UID=; PWD=;"
The ERROR was:  
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.

When I used this string connection:
strConnect = "Provider=SQLOLEDB; Initial Catalog=DB NAME; Source=SERVER NAME; Integrated Security=Yes;"
The ERROR was:
Provider error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

And with this string connection:
'strConnect = "Provider=SQLOLEDB;  Server=DB NAME; Database=DB NAME; Trusted_Connection=Yes;"
The ERROR was:
Microsoft OLE DB Provider for SQL Server error '80004005'
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I could not find a solution that help me with these string connections. I f you have some ideas about these problems, I will apreciate your advices
0
focusmicro
Asked:
focusmicro
4 Solutions
 
kevp75Commented:
those errors (the ones with the null) mean that you are trying to connect to the SQL server using an invalid login.

Make sure you use the correct username/password combo
0
 
SwindleCommented:
This will also happen when your SQL Server authentication is set to Windows Only and you are trying to connect to it with a SQL Server login, or the windows account you are using doesn't have appropriate permissions to access the server.  Here's a kb article about this issue if that is indeed the cause of your problem:

http://support.microsoft.com/kb/889615
0
 
bugs021997Commented:
@focusmicro

I am looking at your issue but firstly try doing this...

1) Double check the security of your SQL server to make sure that whether
it supports windows integrated authentication and sql server
authentication.

2) Use SQL server profiler to audit all the login action to see which login
action failed.
0
 
bugs021997Commented:
@focusmicro....

Its not a connectingstring problem but an authentication issue as specified by @kevp75 earlier...

Try using sql server authentication rather than windows authentication for sql server. Change the authentication settings to Mixed authentication mode under security tab in the sql server properties.


Take a look at the below mentioned sites which shall help you....

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q307/0/02.asp&NoWebContent=1
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q269587
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now