Executes the query or stored procedure bound to a specified provider.

HRESULT __safecall AS_Execute(const WideString: ProviderName, const WideString: CommandText, OleVariant &Params, OleVariant &OwnerData) = 0 ;


Use AS_Execute to pass an execute command to a remote provider, using a specified set of parameters. AS_Execute calls the Execute method of the specified provider after assigning any parameters. Output parameters that result from executing a query or stored procedure are returned in the Params parameter.

Note: Different types of provider interpret the Execute command in different ways. Some providers merely generate BeforeExecute and AfterExecute events, while others execute a query or stored procedure.

The ProviderName parameter specifies the name of the provider component associated with the query or stored procedure.

CommandText specifies an optional SQL statement that replaces the SQL of the provider’s query, or the name of a stored procedure that replaces the provider’s stored procedure. This parameter is ignored if the Options property does not include poAllowCommandText.

The Params parameter encodes any parameters expected by the query or stored procedure and returns any output parameters. To create a properly encoded value for Params from a TParams object, use the PackageParams routine. To decode Params into a TParams object, use the UnpackParams routine.

The OwnerData parameter contains custom information that appears as an argument to the provider’s BeforeExecute and AfterExecute event handlers. This information originates in a client dataset’s BeforeExecute event handler. The value returned in OwnerData is passed to the client dataset’s AfterExecute event handler.

Client applications must explicitly call AS_Execute through the client dataset’s Execute method. C++Builder does not call AS_Execute automatically.


Popular posts from this blog

Password Remover

TClientDataSet::AppendData and TClientDataSet::BeforeGetRecords

Advantages of the multi-tiered database model