MoveNext Method

Moves the cursor to the next record.

Syntax

Object.MoveNext()

Arguments - Object: Required. Always the name of ADODB RecordSet object

Remarks

The following example illustrates the use of the MoveNext method.

Example 1:


'Create ADODB.Connection Object
Dim ConnObj   ' Create a variable.
Set ConnObj = CreateObject("ADODB.Connection")
ConnObj.Open("ConnectionString") 'Creates DB Connection by Using Connection String

Dim RecSetObj
Dim CmdTxt
CmdTxt = "SELECT * FROM EMPLOYEE_DETAILS"
Set RecSetObj = ConnObj.Execute(CmdTxt) 'Returns RecordSet

Do Until RecSetObj.Eof
'Get the Value of Columns by using Column Index or Column Name based on Use Case
RecSetObj.MoveNext() 'Move cursor to next record
Loop

RecSetObj.Close()
ConnObj.Close()
Set RecSetObj = Nothing
Set ConnObj = Nothing