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:
- A Visual Basic or Visual C++ COM EXE server that both accepts an ADO recordset using ByRef [in,out] and inside the method call raises an error.
- A Visual Basic or Visual C++ COM DLL hosted in MTS or COM+ that both accepts an ADO recordset ByRef [in,out] and inside the method call raises an error.
In these situations, the actual error raised by the COM component is not reported to the client; instead, the error "Method '~' of object '~' failed" is reported.
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).