เหตุการณ์EndOfRecordset ของ ADO
❮ การอ้างอิงออบเจ็กต์ชุดระเบียนที่สมบูรณ์
เหตุการณ์คือรูทีนย่อยที่สามารถเรียกได้โดยอัตโนมัติหลังจากมีการดำเนินการเฉพาะเกิดขึ้น
เหตุการณ์ EndOfRecordset ถูกทริกเกอร์เมื่อคุณพยายามย้ายไปยังเรกคอร์ดหลังจากเรกคอร์ดสุดท้ายในชุดระเบียน เหตุการณ์นี้สามารถเกิดขึ้นได้ถ้าตัวชี้เรกคอร์ดอยู่ที่ส่วนท้ายของ Recordset และมีการเรียกเมธอด MoveNext
เคล็ดลับ:คุณสามารถใช้เหตุการณ์นี้เพื่อดึงข้อมูลระเบียนเพิ่มเติมจากฐานข้อมูลและผนวกเข้ากับส่วนท้ายของชุดระเบียน แล้วจึงโทรซ้ำ MoveNext
หมายเหตุ:ก่อนที่เมธอดนี้จะกลับมา ให้ตั้งค่าพารามิเตอร์สถานะเป็น adStatusUnwantedEvent เพื่อป้องกันการแจ้งเตือนที่ตามมา
ไวยากรณ์
EndOfRecordset(moredata,status,objrs)
Parameter | Description |
---|---|
moredata | A boolean value that if true it allows to append more data to the end of the Recordset |
status | An EventStatusEnum value that indicates the status of the execution of the event |
objrs | The name of the Recordset Object that triggered this event |
EventStatusค่า Enum
Constant | Value | Description |
---|---|---|
adStatusOK | 1 | The operation that caused the event was successful |
adStatusErrorsOccurred | 2 | The operation that caused the event failed |
adStatusCantDeny | 3 | The operation that caused the event cannot be cancelled |
adStatusCancel | 4 | The operation that caused the event is cancelled |
adStatusUnwantedEvent | 5 | Prevents subsequent notifications before the event method has finished executing |
❮ การอ้างอิงออบเจ็กต์ชุดระเบียนที่สมบูรณ์