DB2 Version 9.7 for Linux, UNIX, and Windows

RetOleDbConnStr CLI/ODBC configuration keyword

Specifies whether the Mode CLI/ODBC configuration keyword returns a numeric value or string value.

db2cli.ini keyword syntax:
RetOleDbConnStr = 0 | 1
Default setting:
The value for the Mode CLI/ODBC configuration keyword is returned as a string.
Usage notes:

The Mode CLI/ODBC configuration keyword sets the CONNECT mode to either SHARE or EXCLUSIVE. OLE DB expects the value for Mode to have a numeric representation instead of a string representation. RetOleDbConnStr toggles between returning a string and a numeric value.

The possible settings are as follows:
  • 0 - the value returned by SQLDriverConnect() and SQLBrowseConnect()for the Mode keyword is either SHARE or EXCLUSIVE
  • 1 - the value returned by SQLDriverConnect() and SQLBrowseConnect()for the Mode keyword is either 3 (for SHARE) or 12 (for EXCLUSIVE)
For example, if you set RetOleDbConnStr=1 and call SQLDriverConnect()or SQLBrowseConnect() with the following input connection string for a shared connection:
DSN=SAMPLE;MODE=SHARE
then the output connection string will have the following format:
DSN=SAMPLE;UID=;PWD=;MODE=3
If you set RetOleDbConnStr=1 and call SQLDriverConnect()or SQLBrowseConnect() with the following input connection string for an exclusive connection:
DSN=SAMPLE;UID=NEWTON;PWD=SECRET;MODE=EXCLUSIVE
then the output connection string will have the following format:
DSN=SAMPLE;UID=NEWTON;PWD=SECRET;MODE=12

OLE DB applications that use the string representation for the value of the Mode keyword returned by SQLDriverConnect()and SQLBrowseConnect() will receive an error from OLE DB Component Services. OLE DB Component Services returns an error because it expects the keyword Mode to have numeric values. Setting RetOleDbConnStr to 1 avoids this behavior, as the value for Mode will then be numeric.