pyodbc error pyodbc.InterfaceError

connection = pyodbc.connect(r'Driver={SQL Server Native Client 11.0};Server=。。。;Database=。。。;Trusted_Connection=yes;')

When using the above code is connected pyodbc sql database, running on a development machine it is ok, but to other computers on the operation error, the error message is as follows:

pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')。

Checked afternoon Driver found wrong parameter, modify Driver = {SQL Server} it. The reason is that SQL Server is sql server, function relatively complete, SQL Native Client is a client for the user to use the tool, only the window operation database service used on other computers may not be configured 11.0.

Guess you like

Origin www.cnblogs.com/JTCLASSROOM/p/10969242.html