-
Host OS: Ubuntu 24.04 Running inside a virtual environment. PyODBC Version: 5.1 My [ODBC]
Trace = yes
TraceFile = /tmp/odbc.trace
[Tibero7]
Driver = Tibero7Driver
Description = Tibero7 ODBC Datasource
SID = tibero
User = tibero
Password = tmax In this environment, executing the following Python code results in an error: import pyodbc
conn = pyodbc.connect("DSN=Tibero7") Error message:
The error code However, if I uninstall PyODBC 5.1 and install PyODBC 4.0.39, the connection is established without any issues. Upon reviewing the PyODBC code, it appears that starting from version 5.x, the keys If this transformation does affect the Thank you for your assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Are you referring to this? Line 479 in 7a710e7 |
Beta Was this translation helpful? Give feedback.
-
That code only touches the connection string. pyODBC doesn't know about (nor care) the contents of odbc.ini. |
Beta Was this translation helpful? Give feedback.
I did three tests and read the trace files:
The trace files showed that pyodbc 4.0.39 attempts to use SQLConnectW() and, if that fails, it falls back to using SQLConnect(). On the other hand, pyodbc 5.1 only attempts to use SQLConnectW().
here are trace files.
Using pyodbc 4.0.39 with encoding setting (success case)
unixodbctrace-4-with-encoding-setting.log
Using pyodbc 5.1…