Microsoft KB Archive/312994

= FIX: MSDAORA Incorrectly Returns Padded Data for a CONSTANT CHAR(x) Field =

Article ID: 312994

Article Last Modified on 9/26/2005

-

APPLIES TO


 * Microsoft Data Access Components 2.6
 * Microsoft Data Access Components 2.6 Service Pack 1
 * Microsoft Data Access Components 2.6 Service Pack 2
 * Microsoft Data Access Components 2.7
 * Microsoft OLE DB Provider for Oracle Server 1.0
 * Microsoft OLE DB Provider for Oracle Server 1.0

-



This article was previously published under Q312994



SYMPTOMS
When you use the Microsoft Oracle OLE DB Provider (MSDAORA) for Microsoft Data Access Components (MDAC) 2.6 and 2.7 to access an Oracle fixed-length CONSTANT CHAR field, you may find that the length of the string retrieved is far greater than expected. All of the additional characters are spaces.

For example, when you access a CONSTANT CHAR field of fixed length 1, the string retrieved is 32 bytes in length. The string contains the correct first character followed by 31 spaces.

Note that no error is returned when this &quot;padding&quot; occurs.



RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

The English-language version of this fix should have the following file attributes or later:   Date         Version       Size     File name      Platform --  08-Nov-2001  2.62.8108.0   225,552  Msdaora.dll    x86

WORKAROUND
You can work around the problem in either of the following ways:
 * Use RTrim while comparing the values of a CONSTANT CHAR(x) field or while checking its length.
 * Use a CONSTANT VARCHAR(x) field.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.

Additional query words: MSDAORA padding space

Keywords: kbbug kbfix kboracle kbsqlserv2000presp3fix kbqfe kbsqlserv2000sp3fix kbhotfixserver KB312994

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.