Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Paul Watson — source: IBM Community (ConnectedCommunity.org) Informix forum
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.com
Oninit® is a registered trademark of Oninit LLC</module>
↪ replying to Paul Watson
Paul Watson — source: IBM Community (ConnectedCommunity.org) Informix forum
pyodbc 5.latest wont work, you need pyodbc 4.latest
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.