Playing with python ODBC for the first time, the fact isql (unixODBC)
connects seems to imply the ODBC layer is correct, but it fails under
python connect with
-11005 Invalid connection string attribute.
Gotta be something dumb ......
cat odbc_test.py
import pyodbc
print(pyodbc.dataSources())
conn = pyodbc.connect(
"DRIVER=Informix;"
"HOST= 10.10.10.10"
"SERVER=myinstance;"
"SERVICE=1524;"
"DATABASE=sysmaster;"
"PROTOCOL=onsoctcp;"
"UID=someuser;"
"PWD=somepasswd"
)
prod-dbstage: python odbc_test.py
{'yyyyy': 'Informix'}
Traceback (most recent call last):
File "./odbc_test.py", line 4, in <module>
conn = pyodbc.connect(
pyodbc.Error: ('H000', '[H000] [ (-11005) (SQLDriverConnect)')
prod-dbstage: isql myinstance someuser somepasswd
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Note isql cores if you don't pass in the user/passwd
Note: if you turn on ODBC trace in /etc/odbcinst.ini then python cores
--
Cheers
Paul
Paul Watson
Oninit LLC
+1-913-387-7529
www.oninit.comOninit®️ is a registered trademark of Oninit LLC</module>