Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Data Truncated When You Get External Sybase Data


View products that this article applies to.

This article was previously published under Q258871

↑ Back to the top


Symptoms

When you return data to your Microsoft Excel worksheet, data appears randomly truncated, for example:
   Data on server                   Same data in Microsoft Excel
   --------------                   ----------------------------

   Texas, Irving                    Texas,
   Washington, Seattle              Washingto
   North Carolina, Charlotte        North Caroli
				

↑ Back to the top


Cause

This problem occurs when you return data to Microsoft Excel 2000 from Sybase Adaptive Server Anywhere version 6.03.

-and-

The Sybase Open Database Connectivity (ODBC) driver is Dbodbc6.dll, version 6.00.03.2747, dated 8/5/99.

↑ Back to the top


Resolution

This problem no longer occurs in Excel version 2000 and Sybase Adaptive Server Anywhere version 6.03 EBF (emergency bug fix) #2984 or later.

Contact the vendor of your Sybase ODBC driver for an updated ODBC driver.

↑ Back to the top


More information

This data truncation is a result of a problem with translating the ODBC data type to its equivalent data size. Excel 2000 uses SQLBindCol() to bind columns as double-byte characters (two bytes per character), in order to handle Unicode characters.

Earlier versions of Excel bind columns as single-byte characters, because they only expect ANSI characters. The problem occurs when the ODBC SQLBindCol() function receives an incorrect value for the number of bytes of data. Specifically, if the driver gives Excel the string size instead of the byte size, the data is cut in half.

For example, the word Washington is 10 characters long and needs 20 bytes (double bytes). The SQLBindCol() function expects to receive the value 20. 10 characters at 2 bytes per character equals 20 bytes. However, if the ODBC driver returns the string length (10) instead of the number of bytes (20), Excel considers the string length to be 5 (10 divided by 2) and truncates the word Washington to Washi.

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

↑ Back to the top


References

For more information about Sybase, Inc., please see the following Sybase Web site: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

For information about how to contact Sybase Inc, view the following hardware and software third-party vendor contact information: http://support.microsoft.com/gp/vendors/en-us

↑ Back to the top


Keywords: KB258871, kbprb

↑ Back to the top

Article Info
Article ID : 258871
Revision : 4
Created on : 5/29/2008
Published on : 5/29/2008
Exists online : False
Views : 242