Informix

 View Only
  • 1.  ODBC error: SQLSetConnectAttrW with return code -1

    Posted Thu April 02, 2020 11:20 AM
    Edited by System Fri January 20, 2023 04:18 PM
    Greetings and salutations...

    I'm having issues connecting from Microstrategy 2017 Release 3 running in AWS to Informix 11.70.FC9 or 14.10.FC3, running on our servers, both running RHEL, using Informix's CSDK ODBC driver version 4.50.FC3.

    I get the following (snipped) messages in the ODBC trace:

    ENTER SQLSetConnectAttrW ENTER SQLSetConnectAttrW
      SQLHDBC             0x007f963c5fc360
      SQLINTEGER                1041
      SQLPOINTER          [Unknown attribute 1041]
      SQLINTEGER                  -3 
    EXIT  SQLSetConnectAttrW  with return code -1 (SQL_ERROR)
      SQLHDBC             0x007f963c5fc360
      SQLINTEGER                1041
      SQLPOINTER          [Unknown attribute 1041]
      SQLINTEGER                  -3 

    ENTER SQLSetConnectAttrW ENTER SQLSetConnectAttrW
      SQLHDBC             0x007f5f405f9090
      SQLINTEGER                1042
      SQLPOINTER          [Unknown attribute 1042]
      SQLINTEGER                  -3 
    EXIT  SQLSetConnectAttrW  with return code -1 (SQL_ERROR)
      SQLHDBC             0x007f5f405f9090
      SQLINTEGER                1042
      SQLPOINTER          [Unknown attribute 1042]
      SQLINTEGER                  -3 

    Issue occurs when generating a report with Microstrategy or querying from Microstrategy's DB Query Tool. Connectivity with isql works just fine.

    Here are the [ODBC] section and DSN entry in the odbc.ini
    [ODBC]
    Trace=3
    TraceFile=odbctrace.out
    TraceDll=/opt/mstr/MicroStrategy/install/lib/MYtrcXX.so
    InstallDir=/opt/mstr/MicroStrategy/install
    IANAAppCodePage=106
    UseCursorLib=0
    UNICODE=UTF-8
    [FOO]
    Driver=/opt/informix/lib/cli/iclis09b.so
    Description=Report FOO Informix Database IBM Driver
    Database=db_name
    LogonID=username
    pwd=******
    Servername=servername
    CursorBehavior=0
    CLIENT_LOCALE=en_us.utf8
    DB_LOCALE=en_us.utf8
    TRANSLATIONDLL=/opt/informix/lib/esql/igo4a304.so

    (names have been changed to protect the innocent... ^_^ )

    We filter by "customer code", and of 100 customer codes, only one of them returns this error.

    Help please!

    Be well!


    Ramón

    ------------------------------
    Ramon Rey
    Any opinions I express here are my own and not the views of my employer.
    ------------------------------
    #Informix


  • 2.  RE: ODBC error: SQLSetConnectAttrW with return code -1

    Posted Fri April 03, 2020 08:37 AM
    Hi Ramon,
    There seems to be no problem with the contents of the odbc.ini file..
    Was this a setting that worked well in the past? How about using the odbc driver provided by mstr?
    Perhaps the odbc driver is in the path /opt/mstr/MicroStrategy/install/lib.

    Below are the documents I found in the mstr community.

    https://community.microstrategy.com/s/question/0D54400004zknHpCAI/database-instance-error?language=en_US
    https://community.microstrategy.com/s/article/KB31963-Configuring-a-metadata-connection-on-Informix-IDS-in-MicroStrategy?language=undefined

    ------------------------------
    SangGyu Jeong
    Software Engineer
    Infrasoft
    Seoul Korea, Republic of
    ------------------------------



  • 3.  RE: ODBC error: SQLSetConnectAttrW with return code -1

    Posted Fri April 03, 2020 09:58 AM
    SangGyu,
    Thanks for your response!
    The MSTR tools (MSTR Reporting and the DB Query Tool) work just fine with the Merant driver they provide. Unfortunately they will stop support for that driver at the end of this year, so we started using the Informix ODBC driver in CSDK 4.50.FC3. I'm starting to think this is an issue with the ODBC driver manager, not with the driver itself.
    On a curious note, troubleshooting the data, the ODBC MSTR tools fail when a varchar column has EXACTLY 32 blanks inserted in the column. not 31 or below, not 33 or above, no matter the size of the varchar (at or above varchar(32) of course... ^_^ ).
    I'll check for your links out and report back.
    Thanks once more!
    Cheers!

    R

    ------------------------------
    Ramon Rey
    Any opinions I express here are my own and not the views of my employer.
    ------------------------------



  • 4.  RE: ODBC error: SQLSetConnectAttrW with return code -1

    Posted Fri April 03, 2020 10:38 AM
    Edited by System Fri January 20, 2023 04:10 PM
    It is not a document directly related to this issue, but according to the documents below, the 1041 and 1042 options are only recognized by the DataDirect driver.

    http://media.datadirect.com/download/docs/slnk/6_0/distgde/call.html
    https://www.ibm.com/support/pages/apar/JR29115

    By the way, if the error occurs depending on the length of the data, I don't know how it relates to this error code.

    ------------------------------
    SangGyu Jeong
    Software Engineer
    Infrasoft
    Seoul Korea, Republic of
    ------------------------------



  • 5.  RE: ODBC error: SQLSetConnectAttrW with return code -1

    Posted Fri April 03, 2020 09:39 AM
    Hi Ramon,

    Your application must be using one of ODBC Driver Managers(DM), like Microsoft, unixODBC, DataDirect etc. The SQLSetConnectAttrW call with 1041 code attribute is not part of ODBC standard specification. It got to be extension possibly provided by DM. If you could look at your application and provide the "name of the attribute" which has encoded value 1041, we should be able to help better. Below links mentions the ODBC standard attributes supported by its specification. Also, does this error causes any unwanted behaviour in your application? Typically, extended/optional attributes doesn't cause unwanted behaviour (as typically it's one of the "meta calls" and accordingly application adjusts the rest of behaviour).

    https://github.com/microsoft/ODBC-Specification/blob/master/Windows/inc/sql.h
    https://github.com/microsoft/ODBC-Specification/blob/master/Windows/inc/sqlext.h

    Thanks & Regards
    -Shesh

    ------------------------------
    Sheshnarayan Agrawal
    ------------------------------



  • 6.  RE: ODBC error: SQLSetConnectAttrW with return code -1

    Posted Tue April 07, 2020 09:21 AM
    [On behalf of Sheshnarayan Agrawal]

    Hi Ramon,

     

    Your application must be using one of ODBC Driver Managers(DM), like Microsoft, unixODBC, DataDirect etc. The SQLSetConnectAttrW call with 1041 code attribute is not part of ODBC standard specification. It got to be extension possibly provided by DM.  If you could look at your application and provide the "name of the attribute" which has encoded value 1041, we should be able to help better. Below links mentions the ODBC standard attributes supported by its specification. Also, does this error causes any unwanted behaviour in your application? Typically, extended/optional attributes doesn't cause unwanted behaviour (as typically it's one of the "meta calls" and accordingly application adjusts the rest of behaviour).

     

    https://github.com/microsoft/ODBC-Specification/blob/master/Windows/inc/sql.h

    https://github.com/microsoft/ODBC-Specification/blob/master/Windows/inc/sqlext.h

     

    Thanks & Regards

    -Shesh



    ------------------------------
    Srini M.R
    ------------------------------