BUG: Microsoft Access ODBC Driver Incorrectly Maps Unicode Datatypes with SQL_C_DEFAULT (293653)



The information in this article applies to:

  • Microsoft ODBC Driver for Access 4.0

This article was previously published under Q293653

SYMPTOMS

Client applications that call the ODBC API SQLBindCol() function to bind a Unicode data column using SQL_C_DEFAULT will be bound as SQL_C_CHAR. In addition, calling the ODBC API SQLDescribeCol() function on the same column will return the column's datatype as SQL_VARCHAR.

CAUSE

The Microsoft Access ODBC driver intentionally maps these Unicode datatypes to protect older applications that have been written to use SQL_C_DEFAULT. Mapping columns bound with SQL_C_DEFAULT to Unicode datatypes of SQL_WCHAR, SQL_WVARCHAR, or SQL_LONGVARCHAR could potentially break older applications.

RESOLUTION

Applications that require access to extended characters should not bind the Unicode datatype columns as SQL_C_DEFAULT. Instead, these programs should bind Unicode columns as SQL_WCHAR, SQL_WVARCHAR, or SQL_LONGVARCHAR in order to avoid this behavior in the Microsoft Access ODBC driver.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Please note that the "Text" and "Memo" columns in Microsoft Access version 4.0 databases are Unicode data fields.

This behavior is not an issue with .mdb files prior to version 4.0.

REFERENCES

ODBC API Programmer's Reference, MSDN, Platform SDK Documentation.

Modification Type:MajorLast Reviewed:4/8/2001
Keywords:kbbug kbDatabase kbDSupport KB293653