Help Center

CAdoEvents.WillExecutemethod

Called just before a pending command executes on this connection and affords the user an opportunity to examine and modify the pending execution parameters.

Databasesmethoddoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION WillExecute (BYVAL Source AS Afx_BSTR PTR, BYVAL CursorType AS CursorTypeEnum PTR, BYVAL LockType AS LockTypeEnum PTR, BYVAL Options AS LONG PTR, BYVAL adStatus AS EventStatusEnum PTR, BYVAL pCommand AS Afx_ADOCommand PTR, BYVAL pRecordset AS Afx_ADORecordset PTR, BYVAL pConnection AS Afx_ADOConnection PTR) AS HRESULT

Parameters

NameDescription
SourceA BSTR that contains an SQL command or a stored procedure name.
CursorTypeA CursorTypeEnum that contains the type of cursor for the Recordset that will be opened. With this parameter, you can change the cursor to any type during a Recordset Open operation. CursorType will be ignored for any other operation.
LockTypeA LockTypeEnum that contains the lock type for the Recordset that will be opened. With this parameter, you can change the lock to any type during a Recordset Open operation. LockType will be ignored for any other operation.
OptionsA Long value that indicates options that can be used to execute the command or open the Recordset.
adStatusEventStatusEnum. 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.
pCommandThe Command object for which this event notification applies.
pRecordsetThe Recordset object for which this event notification applies.
pConnectionThe Connection object for which this event notification applies.

Description

Called ust before a pending command executes on a connection.

Remarks

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 NULL. If the event is due to Command.Execute, the pCommand parameter will reference the Command object and the pRecordset parameter is set to NULL.

WillExecute allows you to examine and modify the pending execution parameters. This event may return a request that the pending command be canceled.

Reference