Knowledge Base

BUG: Conversion from OS/390 PACKED to DECIMAL and NUMERIC fails

Article ID: 191453

Article Last Modified on 10/6/2004


APPLIES TO


This article was previously published under Q191453

SYMPTOMS

An attempt to display an IBM OS/390 packed decimal record field as converted to the DECIMAL or NUMERIC automation type results in errors. The first manifestation, generally, is that there is no data to display, for example, in a Visual Basic text box.

WORKAROUND

Packed decimal fields can be converted to a string (DBTYPE_STR, CHAR) successfully.

STATUS

Microsoft has confirmed this to be a problem in the OLE DB Provider for AS/400 and VSAM component of Microsoft SNA Server version 4.0 SP1.

MORE INFORMATION

An attempt to convert an IBM OS/390 packed decimal record field to either the NUMERIC (DBTYPE_NUMERIC) or DECIMAL (DBTYPE_DECIMAL) automation types results in the following error manifestations. They are seen when running a Visual Basic consumer in debug mode.
  1. A watch is added for the ADO recordset, and the value of the numeric field is set to "Errors occurred".
  2. When an immediate statement to view the numeric field s executed, for example, "? RS.Fields(10).Value<enter>," the following message box appears:
                Title Bar: Microsoft Visual Basic
                Description: HRESULT 80040e21 (-2147217887)
                             Errors occurred.
    							
  3. An attempt to display this field/column in a text box yields either blanks or nothing.
  4. Issuing an ADO GetRows results in an error being returned from OLE DB Provider with the same HRESULT, -2147217887 (0x80040e21) and the description "Automation error."

Keywords: kbbug kbpending kbsnaonly KB191453