カーソルの現在の位置がRecordSetの末尾にあるかどうかを確認します。
構文
Object.Eof
引数 - 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