커서의 현재 위치가 RecordSet의 끝 부분에 있는지 확인합니다.
구문
Object.Eof
Arguments - Object: 필수 항상 ADODB RecordSet 객체의 이름
반환
커서의 현재 위치가 RecordSet의 끝에 있지 않으면 True, 그렇지 않으면 False입니다.
주석
다음 예에서는 Eof 메소드의 사용을 보여 줍니다.
예 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 WHERE ID = 101"
Set RecSetObj = ConnObj.Execute(CmdTxt) 'Returns RecordSet
If Not RecSetObj.Eof Then
'Fetch the Column Value from the Record Set Object
End If
RecSetObj.Close()
ConnObj.Close()
Set RecSetObj = Nothing
Set ConnObj = Nothing