Home » Access Tips And Tricks » SQL Server Connection Strings

I recently encountered a situation where I was attempting to create a link to a SQL Server table using a UserID and Password, on a SQL Server with Mixed Mode Authentication turned on.  The connection string I was using looked like:
ODBC;Driver=SQL Server Native Client 10.0:Server=<myServerName>;Database=<myDatabaseName>;UID=<myWindowsUserID>;PWD=<myWindowsPassword>
and I kept getting an error with that string:
Login failed for user ‘myWindowsUserID’
Reason: Could not find a login matching the name provided
I then tried a connection string which replaced:
<myWindowsUserID> with <domain\myWindowsUserID>
but this returned another error.
Login failed for user ‘domain\myWindowsUserID’

Reason: Attempting to use an NT account name with SQL Server Authentication
I found this strange because I was able to link the table using “Trusted_Connection=Yes”.  But it turns out that you cannot use your Windows UserID and password as login critieria for SQL Authentication.  Who knew?

One thought on “SQL Server Connection Strings

  1. How can fix this where do I need to go

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *