connection = pyodbc.connect(r'Driver={SQL Server Native Client 11.0};Server=...;Database=...;Trusted_Connection=yes;')
When using pyodbc to connect the SQL database, the above code runs OK on the development machine, but it runs error on other computers. The error information is as follows:
pyodbc.InterfaceError: (‘IM002’, ‘[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)’)。
After checking all afternoon, I found that there was an error in the driver parameter. Just modify it to driver = {SQL Server}. The reason is that SQL server is a SQL Server with complete functions. SQL native client is a client tool for users. It is only used to operate the window of database service. 11.0 may not be configured on other computers. The SQL server installed on the development machine is 2012, while the other machines are 2008.
Similar Posts:
- PXE install windows System Error: pxe-e55:ProxyDhcp service did not reply to request on port 4011
- [Solved] Node Connect MYSQL Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
- Error handling of PLSQL initial login to Oracle
- [Solved] MySql Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts…
- ORA-12518 TNSlistener could not hand off client connection [Solved]
- How to connect Android mobile phone with ADB & reasons and solutions of unable to connect to 192.168.1.100:5555
- Laravel [1045] Solution Access denied for user’homestead’@’localhost’
- Error in connecting to MySQL via Navicat on MAC
- Solution of “could not connect to development server” in react native
- Nginx error 111: connection rejected [How to Solve]