Article ID: 174225 - Last Review: March 2, 2005 - Revision: 1.1 PRB: ADO Error -2147217896 when Calling MoveFirst()This article was previously published under Q174225 SYMPTOMS
Performing a parameterized query such as "Select EmployeeID,
FirstName, LastName from Employees where FirstName = ?" and calling the
MoveFirst() method of the recordset, may cause the following error:
HRESULT = -2147217896 (0x80040E18)
The rowset was built over a live data feed and cannot be restarted
CAUSE
The error can be misleading, but the recordset most likely has a
forward-only cursor. The default cursor type for a recordset returned from a Command Execute() or from the Open()method of a recordset is forward only. Since it is a forward-only cursor, in order to move backwards (as required by a MoveFirst command), ADO re-executes the query and then moves to the requested record. When you set up Parameters in the Parameters collection of the Command object and then call Execute, ADO no longer considers the parameters valid after the Execute. Without valid parameters, the command cannot be re- executed to perform the MoveFirst and the error occurs. RESOLUTION
Three possible solutions follow:
STATUS
This behavior is by design.
APPLIES TO
| Article Translations
|


Back to the top
