BUG: Custom Property from Provider of Type adIDispatch Fails (173659)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.1 SP2
This article was previously published under Q173659 SYMPTOMS
ActiveX Data Objects (ADO) does not correctly recognize properties of type
adIDispatch. If your ADO provider raises a custom property of type
adIDispatch, ADO does not correctly return the interface, for example:
dim val as variant
dim adoprop as adodb.property
...
set val = adoprop.Value
When the current property represented by adoprop is of type adIdispatch,
ADO invokes the Interface's default method rather than the IDispatch
interface, and attempts to return the result from that. If the interface's
default method requires arguments, then the call fails and an error is
returned. This error is dependent on the implementation of the interface,
but typically it appears to be "Type Mismatch" from OLE objects implemented
using MFC OLE.
RESOLUTION
There is no way to work around this bug within ADO. However, if you have
created your own OLE-DB provider, you can get around this by raising the
property, for example, as a column of a given recordset. In this case, you
would bind the IDispatch to a column using the OLE-DB
IAccessor::CreateAccessor interface, and then return that property via the
IRowset:GetData method.
This workaround will work only if you have a custom OLE-DB provider and you
have the source code for your OLE-DB provider.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this bug and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
Modification Type: | Minor | Last Reviewed: | 3/1/2005 |
---|
Keywords: | kbbug KB173659 |
---|
|