ADO WillChangeFieldและ FieldChangeComplete Events
❮ การอ้างอิงออบเจ็กต์ชุดระเบียนที่สมบูรณ์
เหตุการณ์ WillChangeField
เหตุการณ์ WillChangeField จะถูกทริกเกอร์ก่อนที่ค่าของ Field Objects อย่างน้อยหนึ่งรายการจะเปลี่ยนแปลง
หมายเหตุ:ก่อนที่เหตุการณ์นี้จะกลับมา ให้ตั้งค่าพารามิเตอร์สถานะเป็น adStatusCancel เพื่อยกเลิกการดำเนินการที่ทำให้เกิดเหตุการณ์นี้
เหตุการณ์ FieldChangeComplete
เหตุการณ์ FieldChangeComplete จะถูกทริกเกอร์หลังจากมีการเปลี่ยนแปลงค่าของ Field Objects ตั้งแต่หนึ่งรายการขึ้นไป
หมายเหตุ:ก่อนที่เหตุการณ์นี้จะกลับมา ให้ตั้งค่าพารามิเตอร์สถานะเป็น adStatusUnwantedEvent เพื่อป้องกันการแจ้งเตือนที่ตามมา
หมายเหตุ:เหตุการณ์ WillChangeField และเหตุการณ์ FieldChangeComplete อาจเกิดขึ้นเมื่อคุณตั้งค่าคุณสมบัติ Value และเรียกใช้เมธอด Update ด้วยพารามิเตอร์อาร์เรย์ฟิลด์และค่า
ไวยากรณ์
WillChangeField numfields,fields,status,objRs
FieldChangeComplete numfields,fields,objErr,status,objRs
Parameter | Description |
---|---|
numfields | The number of Field objects in fields |
fields | An array that contains Field objects with changes |
status | An EventStatusEnum value that indicates the status of the execution of the event |
objErr | The name of an Error object that describes the error if status is set to adStatusErrorsOccurred, otherwise it is not set |
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 |
❮ การอ้างอิงออบเจ็กต์ชุดระเบียนที่สมบูรณ์