PRB: Setting DBPROP_REMOVEDELETED Property to VARIANT_FALSE Fails to Open Fast-Forward Cursor (289278)
The information in this article applies to:
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
- Microsoft OLE DB Provider for SQL Server 2000 2000.80.194
This article was previously published under Q289278 SYMPTOMS
SQL Server 2000 Books Online contains a section titled "Rowsets and SQL Server Cursors" which states that setting the following rowset properties for the SQL Server OLE DB Provider (SQLOLEDB) is equivalent to a fast-forward cursor:
DBPROP_SERVERCURSOR = true
DBPROP_DEFERRED = false
DBPROP_IRowsetChange = false
DBPROP_IRowsetLocate = false
DBPROP_IRowsetScroll = false
DBPROP_IRowsetUpdate = false
DBPROP_BOOKMARKS = false
DBPROP_CANFETCHBACKWARDS = false
DBPROP_CANSCROLLBACKWARDS = false
DBPROP_CANHOLDROWS = false
DBPROP_LITERALBOOKMARKS = false
DBPROP_OTHERINSERT = true
DBPROP_OTHERUPDATEDELETE = true
DBPROP_OWNINSERT = true
DBPROP_OWNUPDATEDELETE = true
DBPROP_QUICKRESTART = false
DBPROP_IRowsetResynch = false
DBPROP_CHANGEINSERTEDROWS = false
DBPROP_SERVERDATAONINSERT = false
DBPROP_UNIQUEROWS = false
DBPROP_REMOVEDELETED = false
However, if all of these properties are set and a rowset contains a "text", "ntext", or "image" column data type, the following error will be returned from the ICommand::Execute call:
HRESULT = 0x80040e21 (DB_E_ERRORSOCCURRED)
Description = "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
A call to ICommandProperties::GetProperties() to retrieve the properties which could not be set (using DBPROPSET_PROPERTIESINERROR) will show that the DBPROP_OTHERINSERT property caused the error.
CAUSE
The fast-forward SQL Server cursor is converted to a dynamic cursor because fast-forward cursors cannot handle text, ntext, or image fields.
SQL Server 2000 Books Online has a section titled "Implicit Conversion of Fast Forward-only Cursors" which states the following:
"If the SELECT statement references text, ntext, or image columns the cursor is converted to a dynamic cursor if the OLE DB Provider for SQL Server or the SQL Server ODBC driver are used."
Because the SQL Server cursor type is converted to dynamic instead of fast-forward, setting DBPROP_REMOVEDELETED to false conflicts with this.
RESOLUTION
Do not use text, ntext, or image fields in rowsets for which you would like to use fast-forward SQL Server cursors, or change the rowset properties to reflect a dynamic SQL Server cursor.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | kbDatabase kbprb kbProvider KB289278 |
---|
|