English

Error: Method 'Movenext' of object '_Recordset' failed

Error Message

Looping through a database schema ADO recordset using the ESRI OLE DB provider returns "Method 'Movenext' of object '_Recordset' failed" when attempting to move to the next item in the recordset.

Cause

If the ADO connection has been made to an ArcSDE Geodatabase which includes custom COM objects and the class extensions for those objects have not been installed on the local machine, the movenext method on the database schema rowset (recordset) will fail when these objects are encountered.

Solution or Workaround

If it is not feasible to install the custom object extensions locally, trap for the error and resume the loop through the recordset.

Code:
On Error GoTo Err:
.
.
Do Until adors.EOF
.
adors.MoveNext
.
Loop
.
.
Exit Sub

Err:
MsgBox Err.Number & Err.Description, vbExclamation
Resume next
End Sub