The information in this article applies to:
SYMPTOMSIf you try to use the MoveLast method on a forward-only remote data object recordset, you receive the error Forward-only resultsets are the only type returned by the OpenResultset method. CAUSEForward-only cursors only allow the use of MoveNext methods. This is a limitation of ODBC. RESOLUTIONThere 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.
To determine the number of records in a resultset, code a loop like the one
above and increment a count variable inside the loop.
STATUSThis behavior is by design. MORE INFORMATIONWhen RDO works with a forward-only resultset, it uses a call to the ODBC API function SQLExtendedFetch to obtain data. As one of its parameters, this function takes a value that specifies the type of fetch to be performed. ODBC specifies that when a resultset has a forward-only cursor, this fetch argument may only be SQL_FETCH_NEXT. If the argument is something besides this constant, ODBC returns 'S1106: Fetch type out of range,' indicating that the argument was invalid. For more information, see the reference listed in the References section below. Steps to Reproduce
REFERENCESMicrosoft ODBC 2.0 Programmer's Reference and SDK Guide: SQLExtendedFetch function - return code S1106. Additional query words: 4.00 vb4win vb432
Keywords : kbenv kbDatabase kbODBC |
Last Reviewed: September 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |