PRB: Unicode Data is not Converted to ANSI with SQLBindParameter and ANSI ODBC Driver (271198)
The information in this article applies to:
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
This article was previously published under Q271198 SYMPTOMS
The ODBC Driver Manager does not convert Unicode parameter data to ANSI during a call to the ODBC API SQLBindParameter, even when the ODBC driver involved is ANSI. If the ANSI driver saves this parameter data (that is in Unicode format) into its own internal buffer and tries to use it later, the results could be unpredictable. This problem also affects the parameter length, since Unicode strings require twice the buffer space of ANSI strings.
RESOLUTION
The ODBC driver should wait until a SQLExecute or SQLExecDirect call is made. ODBC drivers should not store parameter data or length information during the call to SQLBindParameter.
STATUS
This behavior is by design.
REFERENCES
Microsoft ODBC 3.0 Programmer's Reference and SDK Guide, topic: "SQLBindParameter"; (Chapter 21)
Modification Type: | Major | Last Reviewed: | 5/10/2003 |
---|
Keywords: | kbprb KB271198 |
---|
|