<< Click to Display Table of Contents >>

Navigation:  Ado Events > AdoConnectionEvents Class >


Previous pageReturn to chapter overviewNext page


Please note that event handling is not supported in the current version of Xs2Ado


The WillExecute event is called just before a pending command executes on a connection



METHOD WillExecute (cSource, lCUrsortype, lLocktype, lOptions, lStatus, oCommand, oRecordSet, oConn ) CLASS AdoConnectionEvents



cSource        A String that contains an SQL command or a stored procedure name.

lCursorType        A CursorTypeEnum that contains the type of cursor for the Recordset that will be opened.

lLockType        A LockTypeEnum that contains the lock type for the Recordset that will be opened

lOptions        A Long value that indicates options that can be used to execute the command or open the Recordset

lStatus        An AdoEventStatusEnum status value. This parameter is set to adStatusOK if the operation  that caused the event was successful, or to adStatusErrorsOccurred if the operation failed

oCommand        The Command object for which this event notification applies.

oRecordSet        The RecordSet object for which this event notification applies.

oConn        The Connection object for which this event occurred




You can prevent subsequent notifications by setting the lStatus parameter to adStatusUnwantedEvent before the event returns.        

You can change the values for lCursorType, lLockType and lOptions during a RecordSet Open operation A WillExecute event may occur due to a Connection:Execute, Command:Execute, or Recordset:Open method The oConn parameter should always contain a valid reference to a Connection object. If the event is due to Connection:Execute, the oRecordset and oCommand parameters are set to NULL_OBJECT. If the event is due to RecordSet:Open, the oRecordset parameter will reference the Recordset object and the oCommand parameter is set to NULL_OBJECT. If the event is due to Command:Execute, the oCommand parameter will reference the Command object and the oRecordset parameter is set to NULL_OBJECT.


See Also

AdoConnectionEvents, AdoEventStatusEnum, AdoCursorTypeEnum, AdoLockTypeEnum, AdoCommand:Execute(), AdoConnection:Execute, AdoRecordSet:Open