How to connect to MSSQL in non-transparent mode by Python

I can connect to MSSQL in non-transparent mode by SSMS.

for example:

SQL: 10.10.10.216

SPS: 10.101.5.60

Server Name: 10.101.5.60

Login: sa%10.10.10.216

Password: ************

But I can't connect by Python

username = 'sa%10.10.10.216'
sql_server = '10.101.5.60'
db_name = 'TestDB'
conn = pyodbc.connect('DRIVER={SQL Server}; SERVER='+sql_server+',1433; DATABASE='+db_name+'; UID='+username+'; PWD='+password+''
)


The error messages is below:

pyodbc.OperationalError: ('08S01', '[08S01] [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error. Check your network documentation. (11) (SQLDriverConnect); [08S01] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()). (11)')

Parents Reply Children
No Data