Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Python ODBC and 11005

    Posted 19 days ago
    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>


  • 2.  RE: Python ODBC and 11005

    Posted 18 days ago
    pyodbc 5.latest wont work, you need pyodbc 4.latest

    On 6/10/2025 2:47 PM, Paul Watson via IBM TechXchange Community wrote:
    010001975b625dff-da7b5584-fa0d-4e2d-80d0-49e449cb7edb-000000@email.amazonses.com">
    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 ... -posted to the "Informix" group