Article ID: 264701 - View products that this article applies to.
This article was previously published under Q264701
This article has been archived. It is offered "as is" and will no longer be updated.
If you pass an ADO recordset by using a ByRef method parameter to an out-of-process COM object and the out-of-process COM object generates an error, this error information may not be properly reported to the client application.
When an ADO recordset is marshalled out-of-process using a ByRef method parameter, custom marshalling code implemented by ADO on both the client and server sides is activated, and this code resets the pending OLE error object that is generated by the COM object.
This problem is fixed in the latest service packs for Windows 2000 and MDAC 2.5.
Date Time Version Size File name Platform --------------------------------------------------------------- 06/09/2000 13:02 2.50.5408.0 327,952 Msadce.dll x86 06/09/2000 12:46 2.50.5408.0 487,696 Msado15.dll x86
One workaround is to pass in an ADO recordset using a ByVal parameter and then return an ADO recordset using an return value.
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 2.5 Service Pack 2 and Microsoft Windows 2000 Service Pack 2.
A ByRef parameter is a COM method parameter defined by the COM object's type library as an [in,out] parameter. In Microsoft Visual Basic (VB), if you create a COM object and add the ByRef keyword before some method parameter, Visual Basic will set up this method to both accept and return an object variable by using the [in,out] directive in the COM object's type library.
This problem has been reproduced under the following scenarios:
Note that you will need to apply this fix to both the client and server machines in order to resolve the issue in cases where client and COM server are on two independent computers (for example, when using DCOM to a remote COM server).