-1

I have successfully installed Informix Client SDK and unixODBC in Linux. I tested the connection with isql and it can connect and do queries.

How I currently do the setup:

  • SQLhost: /opt/informix/etc/sqlhost
  • odbc.ini: /etc/unixODBC/odbc.ini
  • odbcinst.ini: /etc/unixODBC/odbcinst.ini
  • Environment variables: INFORMIXDIR, INFORMIXSERVER, INFORMIXSQLHOSTS, ODBCINI

I run my Rust Program and having this error:

Error: ODBC emitted an error calling 'SQLConnect':
State: I000, Native error: -11041, Message: [unixODBC][

With a cut-off error message. I found an online PDF on ODBC-Informix guide stating that error:

-11041 refers to "Data source not found and no default driver specified"

My guess for this issue:

  1. Wrong directory for odbc.ini & odbcinst.ini because I see some people use /etc/odbc.ini & /etc/odbcinst.ini. But isql can run using DSN from /etc/unixODBC/odbc.ini. I tried, output same error.

  2. Could it be unixODBC current version not compatible with the Informix version I'm using?

  3. Probably from my Rust program? I'm using crate odbc-api. Reading the documentation, no need to include anything related to Linux. Just setup ODBC. This Rust program works perfectly in ODBC-Windows.

  4. File permissions in Linux.

Has anyone encountered a similar situation? If so, could you please provide assistance or advice?

Andromeda
  • 1,205
  • 1
  • 14
  • 21
  • 1
    If you tried `isql` and got the same error, stick with that, No point testing Rush or anything else until you get UnixODBC's isql running. The text error implies that it is not finding the DSN, nothing to do with the Informix driver, maybe is looking somewhere else so get a `truss` output and check which files (*.ini) is loading. Check the ODBC chapter in this redbook (https://www.redbooks.ibm.com/redbooks/pdfs/sg247884.pdf) It may help – jsagrera Jul 24 '23 at 18:53
  • Also, check the UNICODE value (UCS-4, UTF8) in your ODBC.INI, Sometimes that makes a difference depending on the application and may raise the same "DSN not found" error. – jsagrera Jul 24 '23 at 20:07
  • Hi @jsagrera. `isql` connection to Informix is working, that's why I wonder why Rust-Informix fail to connect using ODBC. Btw, thank you for your suggestions. Will definitely check them out. – loopwinter Jul 25 '23 at 01:21
  • Changing UNICODE from UCS-4 to UCS-2, finally my Rust program can work! – loopwinter Aug 09 '23 at 07:03

0 Answers0