31
Applications / ODBC v 3 - SQLConnectW() - DB2 CLI
« on: December 17, 2018, 08:00:00 pm »
The DB2 v 7 ODBC driver is at version 3.52, which supports Unicode. The ODBC driver manager shipped with Lotus Smartsuite is version 3 - which was before Unicode was supported.
When I attempt to connect to DB2 using a DB2 v 7 ODBC driver with a version 3 ODBC Driver Manager I crash. It appears to me from tracing that the ODBC driver manager is, for some reason, calling the wide/unicode version of the DB2 CLI functions instead of the ANIS version. For example there is a SQLConnect() which is ANSI and a SQLConnectw() which is unicode; SQLConnectw() is getting called.
I assume my crashing is related to wide version returning data in buffers allocated for ANSI lengths of data. My believe is, in part, based on the tracing, and the fact that if I call SQLConnect() directly by linking to the CLI library rather than the ODBC library the connection succeeds.
It also appears from IBM documentation that the DB2's defaults to the wide/unicode versions unless, somehow, restricted to ANSI functions. For example there is a db2cli.ini keyword DisableUnicode=1 listed in the version 11 documentation which I cannot find in the version 7 documentation.
Does anyone know how to restrict to ANSI only for DB2 v 7?
When I attempt to connect to DB2 using a DB2 v 7 ODBC driver with a version 3 ODBC Driver Manager I crash. It appears to me from tracing that the ODBC driver manager is, for some reason, calling the wide/unicode version of the DB2 CLI functions instead of the ANIS version. For example there is a SQLConnect() which is ANSI and a SQLConnectw() which is unicode; SQLConnectw() is getting called.
I assume my crashing is related to wide version returning data in buffers allocated for ANSI lengths of data. My believe is, in part, based on the tracing, and the fact that if I call SQLConnect() directly by linking to the CLI library rather than the ODBC library the connection succeeds.
It also appears from IBM documentation that the DB2's defaults to the wide/unicode versions unless, somehow, restricted to ANSI functions. For example there is a db2cli.ini keyword DisableUnicode=1 listed in the version 11 documentation which I cannot find in the version 7 documentation.
Does anyone know how to restrict to ANSI only for DB2 v 7?