The WillExecute event is called just before a pending command executes on a connection.
WillExecute Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection
Before this event returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications, or adStatusCancel to request cancellation of the operation that caused this event.
A WillExecute event may occur due to a Connection.Execute, Command.Execute, or Recordset.Open method The pConnection parameter should always contain a valid reference to a Connection object. If the event is due to Connection.Execute, the pRecordset and pCommand parameters are set to Nothing. If the event is due to Recordset.Open, the pRecordset parameter will reference the Recordset object and the pCommand parameter is set to Nothing. If the event is due to Command.Execute, the pCommand parameter will reference the Command object and the pRecordset parameter is set to Nothing.
WillExecute allows you to examine and modify the pending execution parameters. This event may return a request that the pending command be canceled.
Note If the original source for a Command is a stream specified by the CommandStream property, assigning a new string to the WillExecute Source parameter changes the source of the Command. The CommandStream property will be cleared and the CommandText property will be updated with the new source. The original stream specified by CommandStream will be released and cannot be accessed.
If the dialect of the new source string differs from the original setting of the Dialect property (which corresponded to the CommandStream), the correct dialect must be specified by setting the Dialect property of the command object referenced by pCommand.
Applies To: Connection Object
© 1998-2001 Microsoft Corporation. All rights reserved.