PRB: RDO Forward-Only Cursor Doesn't Allow MoveLast (141171)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q141171 SYMPTOMS
If you try to use the MoveLast method on a forward-only remote data object
recordset, you receive the error
"S1106: [Microsoft][ODBC SQL Server Driver]Fetch type out of range".
Forward-only resultsets are the only type returned by the OpenResultset
method.
CAUSE
Forward-only cursors only allow the use of MoveNext methods. This is a
limitation of ODBC.
RESOLUTION
There is no direct way to implement an exact copy of MoveLast with code
when using a resultset with a forward-only cursor. The following code loops
through and touches all records in a resultset. When the loop finishes, the
current record will be the EOF marker.
'The following code loops through all the records in a resultset
While Not rdoToMove.EOF
'do any processing here
rdoToMove.MoveNext
Wend
To determine the number of records in a resultset, code a loop like the one
above and increment a count variable inside the loop.
STATUS
This behavior is by design.
REFERENCES
Microsoft ODBC 2.0 Programmer's Reference and SDK Guide: SQLExtendedFetch
function - return code S1106.
Modification Type: | Major | Last Reviewed: | 11/7/2003 |
---|
Keywords: | kbDatabase kbenv kbprb KB141171 |
---|
|