RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TLocalAppServer.AS_Execute Method

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

Pascal
procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); safecall;
C++
__fastcall AS_Execute(const BSTR ProviderName, const BSTR CommandText, OleVariant Params, OleVariant OwnerData);

Use AS_AS_Execute to pass an execute command to a remote provider, using a specified set of parameters. AS_AS_Execute calls the AS_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. 

The provider's AS_Execute method generates a BeforeAS_Execute event, passes the command on to its associated dataset, and generates an AfterAS_Execute event. The dataset must represent a query or stored procedure that does not return a cursor. 

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 query, or the name of a stored procedure that replaces the dataset's stored procedure. This parameter is ignored if the provider's 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 BeforeAS_Execute and AfterAS_Execute event handlers. This information originates in a client dataset's BeforeAS_Execute event handler. The value returned in OwnerData is passed to the client dataset's AfterAS_Execute event handler. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!