PRB: ADO adMarshalModified Causes Problem with Late Binding (229654)
The information in this article applies to:
- ActiveX Data Objects (ADO) 1.5
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q229654 SYMPTOMS
Using disconnected recordsets in ADO, it is possible to encounter a problem when passing recordsets out of process to a custom business object for updating. The problem occurs when you use the adMarshalModifiedOnly option before you pass the recordset. If the client code uses late binding to the custom business object with the adMarshalModifiedOnly property, the recordset will be passed to the business object ByVal. In addition, it will be passed back to the client and overwrite the original recordset making any changes to the recordset by the business object visible to the client. Consequently, the client will only see the records that were marshalled to the business object, for example, only the modified rows. This problem does not occur if early binding to the business object.
RESOLUTION
There are two possible workarounds to this problem:
- Do not use the adMarshalModifiedOnly option when you send the recordset back to the server for updating.
- Use early binding when you connect to the business object.
These workarounds are demonstrated in the below code.
STATUS
This is by design.
When you use late-binding, IDispatch, the Recordset will always be passed by reference.
REFERENCES
For more information, please see the following article in the Microsoft Knowledge Base:
190717 INFO: Disconnected Recordsets with ADO or RDS
Modification Type: | Major | Last Reviewed: | 11/3/2003 |
---|
Keywords: | kbDatabase kbDCOM kbprb KB229654 |
---|
|