檢查資料指標的目前位置是否在 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