Article ID: 264442
This article was previously published under Q264442
This article has been archived. It is offered "as is" and will no longer be updated.
When you pass a disconnected ADO Recordset between two COM objects in the same COM+ application, certain extended properties of the Recordset such as the Filter property are lost. Under a similar configuration in a Microsoft Transaction Server (MTS) Package on Microsoft Windows NT 4.0, the extended properties are not lost.
COM+ now performs in-process marshalling when passing an ADO Recordset between two COM objects. When performing in-process marshalling, ADO creates the equivalent of a clone of the Recordset, rather than marshalling the existing ADO Recordset interface pointer. This causes a loss of extended properties such as the Filter property. The same loss of extended properties occurs when you create a clone of an ADO Recordset, or when you pass a disconnected ADO Recordset out-of-process, but these particular cases are by design.
This problem is fixed in the latest service packs for Windows 2000 and MDAC 2.5.
Date Time Version Size File name Platform ------------------------------------------------------------------ 05/23/2000 22:22 2.51.5629.0 327,952 Msadce.dll x86 05/23/2000 22:19 2.51.5629.0 487,696 Msado15.dll x86
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Data Access Components (MDAC) version 2.5 Service Pack 2, MDAC version 2.6, and Microsoft Windows 2000 Service Pack 2.
In COM+, when an object such as an ADO Recordset is passed between two COM objects in the same COM+ application, the object is marshalled in-process rather than just passed as an interface pointer without marshalling. This occurs in COM+ even if the caller and callee COM objects are in the same process, thread, and COM apartment. When COM+ attempts to marshal an object between two COM objects, it queries for an IMarshal interface from the passed object. If the passed object returns an IMarshal interface, COM+ uses this interface to marshal the object in-process by calling IMarshal::MarshalInterface using the MSHCTX_INPROC flag.
Prior to applying this hotfix, a disconnected ADO Recordset implements in-process marshalling by creating the equivalent of a clone of the Recordset, which does not copy all of the Recordset extended properties such as Filter. So, if you pass an ADO Recordset between two COM objects in COM+, the extended properties such as Filter are lost.
After you apply the hotfix, ADO performs in-process marshalling using the Free Threaded Marshaler (FTM), which is equivalent to passing an interface pointer to the original object from caller to callee. Using the FTM, ADO can efficiently marshal an ADO Recordset inside COM+ and maintain all of the extended properties.
Note that if you pass a connected ADO Recordset that has its CursorLocation property set to adUseServer, this Recordset does not lose extended properties if passed between two COM objects in a COM+ application.