Microsoft KB Archive/288210

= PRB: ADO Client Cursor Doesn't Allow Custom OLE DB Properties to Be Seen =

Article ID: 288210

Article Last Modified on 4/25/2001

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6

-



This article was previously published under Q288210



SYMPTOMS
When an OLE DB provider supports custom rowset properties, those properties cannot be seen when the client cursor is specified (adUseClient). This means that the property cannot be read or set.



CAUSE
This is a limitation of the client cursor engine.



RESOLUTION
The only solution is to not use adUseClient for the cursor location.



STATUS
This behavior is by design.



MORE INFORMATION
The following Microsoft Visual Basic code demonstates the problem: Private Sub Command1_Click Dim con As New Connection Dim rs As New Recordset

con.CursorLocation = adUseClient con.Open &quot;Provider=CustomProps.ATLCustomProps.1&quot; Set rs.ActiveConnection = con rs.Properties(&quot;My Rowset Property&quot;) = &quot;my value&quot; 'Debug.Print rs.Properties(&quot;My Rowset Property&quot;) rs.Open &quot;c:\\*.*&quot;,, adOpenForwardOnly, adLockOptimistic Either of the two lines that reference &quot;My Rowset Property&quot; will fail. In Visual Basic, an error code of 3265 is returned with the following text:

Method 'Item' of object 'Properties' failed.

-or-

Item cannot be found in the collection corresponding to the requested name or ordinal.

In Microsoft Visual C++, the HRESULT returned from reading or setting the property is 0x800a0cc1, which is the following error:

Item cannot be found in the collection corresponding to the requested name or ordinal.

When adUseClient is removed, the property can be read and set correctly. The value of the property is set and retrieved.

