PRB: Marshalling ADO Recordsets During an AddNew Method (271553)



The information in this article applies to:

  • Microsoft Data Access Components 1.5
  • Microsoft Data Access Components 10
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.1 (GA)
  • Microsoft Data Access Components 2.1 SP1
  • Microsoft Data Access Components 2.1 SP2
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.5 SP1
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7

This article was previously published under Q271553

SYMPTOMS

When an ActiveX Data Objects (ADO) recordset is marshalled out-of-process while an AddNew method is pending on the recordset, the result is that strings are set to zero length strings and numeric fields are set to zero.

STATUS

This behavior is by design. Therefore, to avoid possible errors within your applications, Microsoft recommends that you either first save the current record or explicitly set all the values as appropriate before the recordset is marshalled.

MORE INFORMATION

When marshalling a recordset across apartment boundaries from one component to another while an AddNew is pending on the recordset, it is strongly suggested that the component explicitly set the column values as expected prior to marshalling the recordset. If a recordset is marshalled during an AddNew without the respective Update operation being invoked, all character fields are set to zero length strings and numeric columns are set to zero. Any component that receives the marshalled recordset must account for this behavior. This behavior is by design when marshalling any object and is not specific to ADO. It is the developer's responsibility to explicitly set column values to an appropriate value or NULL prior to marshalling the recordset.

Modification Type:MajorLast Reviewed:5/8/2003
Keywords:kbprb KB271553