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



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.5
  • ActiveX Data Objects (ADO) 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 "Provider=CustomProps.ATLCustomProps.1"
  Set rs.ActiveConnection = con
  rs.Properties("My Rowset Property") = "my value"
  'Debug.Print rs.Properties("My Rowset Property")
  rs.Open "c:\\*.*", , adOpenForwardOnly, adLockOptimistic
				
Either of the two lines that reference "My Rowset Property" 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.

REFERENCES

The following article in the Microsoft Knowledge Base also references this problem:

258997 INFO: Oracle OLE DB Provider and ROWID Use


Modification Type:MajorLast Reviewed:4/25/2001
Keywords:kbprb KB288210