I ran into this issue where I couldn't connect to SQL server using the credentials . I can connect when using trusted connection = yes . Am I doing something wrong here ? Should something be added or concidered ?
conn = pyodbc.connect('Driver={SQL Server Native Client 11.0};'
'Server=1070010-01;'
'Database=test_DB;'
'Uid =sa;'
'Pwd =SDTK-1111;'
)
I have also tried replacing Uid and Pwd with username and password . I have also tried adding trusted_connection = no In all the above cases , I get this error :
conn = pyodbc.connect('Driver={SQL Server Native Client 11.0};'
pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect); [28000] [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute (0); [28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user ''. (18456); [28000] [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute (0)")