Show: Delphi C++
Display Preferences

Datasnap.Midas.IAppServer.AS_GetRecords

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function  AS_GetRecords(const ProviderName: OleStr; Count: Integer; out RecsOut: Integer;  Options: Integer; const CommandText: OleStr; var Params: OleVariant; var OwnerData: OleVariant): OleVariant; safecall;

C++

virtual HRESULT __safecall AS_GetRecords(const System::WideString ProviderName, int Count, /* out */ int &RecsOut, int Options, const System::WideString CommandText, System::OleVariant &Params, System::OleVariant &OwnerData, System::OleVariant &__AS_GetRecords_result) = 0 ;

Properties

Type Visibility Source Unit Parent
function public
Datasnap.Midas.pas
Datasnap.Midas.hpp
Datasnap.Midas IAppServer


Description

Returns a data packet that contains the specified data.

Call AS_GetRecords to retrieve a specified number of records. AS_GetRecords returns the requested records, starting with the current record of the provider's dataset. When working with a stateless remote data module, you may need to reposition the cursor or re-execute a query or stored procedure in the provider's BeforeGetRecords event handler.

ProviderName gives the name of the provider component that provides the records.

Count indicates the number or type of records to retrieve. If Count is -1, all records are retrieved. If Count is 0, only metadata is retrieved. If Count is greater than 0, only Count records are retrieved.

RecsOut returns the actual number of records retrieved.

Options indicates what information should be added to the data packet in addition to data. It is a combination of the GetRecordOption constants. For example, the following value requests metadata along with a data packet encoded in XML:



MetaDataOption + XMLOption



MetaDataOption || XMLOption



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

Params is a Variant containing any parameters that should be passed to the provider's dataset before it executes to generate the requested data. It returns any output parameters. You can convert between the Variant format for parameters used by this argument and a TParams object using the global PackageParams and UnpackParams routines.

OwnerData contains custom information that is supplied by a client dataset's BeforeGetRecords event handler. This information is passed to the provider's BeforeGetRecords event handler. OwnerData returns information supplied by the provider's AfterGetRecords event handler.

Records are returned as a data packet in a Variant (as the return value in Delphi or the AS_GetRecords _result parameter in C++).

See Also

Personal tools
In Other Languages
Previous Versions
Assistance