w3pop.com :: ÍøÂçѧԺ :: ADO :: ADO WillMove Óë MoveComplete Ê
The WillMove event is triggered before an operation changes the current position in the Recordset.
WillMoveʼþÊÇÔÚÒ»¸ö²Ù×÷³ÌÐò¸Ä±äÁ˼Ǽ¼¯ÖмǼµÄµ±Ç°Î»ÖÃ֮ǰ±»¼¤·¢µÄ¡£
Note: Before this event returns, set the status parameter to adStatusCancel to cancel the operation that caused this event or set it to adStatusUnwantedEvent to prevent subsequent notications.
×¢Ò⣺ÔÚ·µ»ØÕâ¸öʼþ֮ǰ£¬½«status[״̬]²ÎÊýÉèÖÃΪadStatusCancel¿ÉÒÔÈ¡ÏûÔËÐиÃʼþµÄ²Ù×÷³ÌÐò£»»òÕß½«ÆäÉèÖÃΪadStatusUnwantedEvent¿ÉÒÔ×èÖ¹½ÓÏÂÀ´Ò»ÏµÁеÄͨ¸æÌáʾ¡£
The MoveComplete event is triggered after the current position in the Recordset has changed.
MoveCompleteʼþÊÇÔÚÒ»¸ö²Ù×÷³ÌÐò¸Ä±äÁ˼Ǽ¼¯ÖмǼµÄµ±Ç°Î»ÖÃÖ®ºó±»¼¤·¢µÄ¡£
Note: Before this event returns, set the status parameter to adStatusUnwantedEvent to prevent subsequent notifications.
×¢Ò⣺ÔÚÄã·µ»ØÕâ¸ö·½·¨Ö®Ç°£¬½«status[״̬]²ÎÊýÉèÖÃΪadStatusUnwantedEvent¿ÉÒÔ×èÖ¹½ÓÏÂÀ´Ò»ÏµÁеÄͨ¸æÌáʾ¡£
Note: The WillMove event or MoveComplete event may occur when calling one of the following Recordset method: Open, Move, MoveFirst, MoveLast, MoveNext, MovePrevious, AddNew, and Requery. These events may also occur because of the following properties: Filter, Index, Bookmark, AbsolutePage, and AbsolutePosition.
×¢Ò⣺WillMoveʼþ»òMoveCompleteʼþ»áÔÚÇëÇóÁËÏÂÁÐRecordset[¼Ç¼¼¯]·½·¨ÖÐµÄÆäÖÐÒ»¸öÖ®ºó±»´¥·¢£ºOpen¡¢Move¡¢MoveFirst¡¢MoveLast¡¢MoveNext¡¢MovePrevious¡¢AddNewºÍRequery£»Í¬ÑùµØ£¬ÉèÖÃÁËÏÂÁÐÊôÐÔµÄÆäÖÐÒ»¸öÒ²¿ÉÄܻᴥ·¢ÉÏÊöʼþ£ºFilter¡¢Index¡¢Bookmark¡¢AbsolutePageºÍAbsolutePosition¡£
WillMove reason,status,objRs MoveComplete reason,objErr,status,objRs |
| Parameter²ÎÊý | DescriptionÃèÊö |
|---|---|
| reason | An EventReasonEnum value that specifies the reason for this event Ö¸¶¨Ò»¸öEventReasonEnumÖµ¡£ËüÊÇÓÃÀ´Ö¸¶¨Ê¼þ¼¤·¢µÄÔÒòµÄ |
| status | An EventStatusEnum value that indicates the status of the execution of the event Ö¸¶¨Ò»¸öEventStatusEnumÖµ£¬ÓÃÓÚָʾʼþÖ´ÐеÄ״̬ |
| objErr | The name of an Error object that describes the error if status is set to adStatusErrorsOccurred, otherwise it is not set Ö¸¶¨Ò»¸ö´íÎó¶ÔÏóµÄÃû³Æ¡£Èç¹ûstatus[״̬]ÉèÖÃΪadStatusErrorsOccurred£¬ÄÇô¸Ã¶ÔÏó½«ÃèÊö¾ßÌåµÄ´íÎóÐÅÏ¢ |
| objRs | The name of the Recordset object that triggered this event Ö¸¶¨¼¤·¢¸ÃʼþµÄ¼Ç¼¼¯¶ÔÏóµÄÃû³Æ |
| Constant³£Á¿ | ValueÖµ | DescriptionÃèÊö |
|---|---|---|
| adRsnRequery | 7 | An operation requeried the Recordset Ö¸¶¨Ò»¸öÇëÇó¼Ç¼¼¯µÄ²Ù×÷ |
| adRsnMove | 10 | An operation moved the record pointer within the Recordset Ö¸¶¨Ò»¸öÔڼǼ¼¯ÄÚÒÆ¶¯¼Ç¼ָÕëµÄ²Ù×÷ |
| adRsnMoveFirst | 12 | An operation moved the record pointer to the first record in the Recordset Ö¸¶¨Ò»¸ö½«¼Ç¼ָÕëÒÆ¶¯µ½¼Ç¼¼¯ÄÚµÚÒ»Ìõ¼Ç¼µÄ²Ù×÷ |
| adRsnMoveNext | 13 | An operation moved the record pointer to the next record in the Recordset Ö¸¶¨Ò»¸ö½«¼Ç¼ָÕëÒÆ¶¯µ½¼Ç¼¼¯ÄÚÏÂÒ»Ìõ¼Ç¼µÄ²Ù×÷ |
| adRsnMovePrevious | 14 |
An operation moved the record pointer to the previous record in the Recordset |
| adRsnMoveLast | 15 | An operation moved the record pointer to the last record in the Recordset Ö¸¶¨Ò»¸ö½«¼Ç¼ָÕëÒÆ¶¯µ½¼Ç¼¼¯ÄÚ×îºóÒ»Ìõ¼Ç¼µÄ²Ù×÷ |
| 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 ²»¿ÉÒÔÈ¡ÏûÕý´¦ÓÚ´¦ÀíÖ´ÐÐÖеIJÙ×÷ |
| adStatusCancel | 4 | The operation that caused the event is cancelled È¡Ïû¼¤·¢Ê¼þµÄ²Ù×÷ |
| adStatusUnwantedEvent | 5 | Prevents subsequent notifications before the event method has finished executing ÔÚʱ¼äµÄÔËÐз½·¨ÖÕÖ¹ÔËÐÐ֮ǰ½ûÖ¹ºóÐøµÄ±¨¸æ |
ÆÀÂÛ (0)
All