BUG: SQLColumns Return Incorrect BUFFER_LENGTH and CHAR_OCTET_LENGTHID: Q236871
|
When SQLColumns is called on a table in an Access database, the BUFFER_LENGTH and CHAR_OCTET_LENGTH values that are returned are incorrect for non-UNICODE text fields. Fields of data type CHAR and VARCHAR will show these lengths as twice the value of COLUMN_SIZE.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
"TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE",
"TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS",
"NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF",
"SQL_DATA_TYPE","SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
"ORDINAL_POSITION", "IS_NULLABLE", "ORDINAL"
"C:\testmdbs\NWIND", <Null>, "Categories", "CategoryName", 12,
"VARCHAR", 15, 30, <Null>, <Null>, 1, "Name of food category.",<Null>,
12, <Null>, 30, 2, "YES", 2<BR/>
You can see that the CategoryName column is a VARCHAR of size 15, but BUFFER_LENGTH and CHAR_OCTET_LENGTH are 30 when they should also be 15.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Sarah Parra, Microsoft Corporation
See the documentation for SQLColumns for more information on the data that this function returns.
The ODBC Test utility can be obtained from the Microsoft Data Access SDK, which comes with Visual Studio or can be downloaded from the following Web
site:
http://www.msdn.microsoft.com
Additional query words: odbcjt32.dll mdac 2.1 buffer
Keywords : kbDatabase kbDriver kbJET kbMDAC kbODBC kbGrpVCDB kbDSupport
Version : WINDOWS:4.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: August 3, 1999