MoveNext 메소드

커서를 다음 레코드로 이동합니다.

구문

Object.MoveNext()

Arguments - Object: 필수 항상 ADODB RecordSet 객체의 이름

주석

다음 예에서는 MoveNext 메소드의 사용을 보여 줍니다.

예 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