The window user details is different from the Sql Server user I log in. So I had tried to use pyodbc connect to the database using the username(Admin_JJack) and password. But the connection show fails for the Window User(Jack) and I don't know where goes wrong.
my connection string :
connection = pyodbc.connect(
"Driver={"SQL Driver"};"
"Server= "ServerName";"
"Database="DatabaseName";"
"UID="UserName";"
"PWD="Password";"
"Trusted_Connection=yes"
)
pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'Jack'. (18456) (SQLDriverConnect);
How to connect to the database using sql server authentication ?
When you use "Trusted_Connection=yes" both the UID and PWD keys are ignored and the Windows account is used for authentication.
If you want to use the UID and PWD values for authentication instead of the Windows NTLM account you must use "Trusted_Connection=No" or remove this option from the connection string.
source: https://msdn.microsoft.com/