PRB: ADO Does Not Support Decimal Numbers with Precision That Is Greater Than 28 (327557)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
This article was previously published under Q327557 SYMPTOMS
When ActiveX Data Objects (ADO) queries a table that contains a numeric or decimal value with a precision that is greater than 28, you receive the following error message:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
CAUSE
ADO returns all values in VARIANTs. The decimal value of a VARIANT is documented to hold a decimal value with a maximum precision of 28:
Decimal variables are stored as 96-bit (12-byte) unsigned integers scaled by a variable power of 10. VT_DECIMAL uses the entire 16 bytes of the Variant.
Data types such as Oracle NUMBER can have a precision of up to 38. However, ADO cannot support these large values because of the restriction in a VARIANT.
RESOLUTION
An application can still work with these large numbers through OLE DB. By writing an OLE DB DLL that Microsoft Visual Basic (or any other client application) can call, an application can fetch these large numbers and can store the results in a double.
For additional information about how to retrieve such large numbers and how to store large numbers in a double, click the article number below
to view the article in the Microsoft Knowledge Base:
229884 HOWTO: Use OLE DB DBTYPE_VARNUMERIC
Modification Type: | Major | Last Reviewed: | 5/28/2003 |
---|
Keywords: | kbprb KB327557 |
---|
|