Datasnap.Provider.TDataSetProvider.DoBeforeGetRecords

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DoBeforeGetRecords(Count: Integer; Options: Integer;  const CommandText: OleStr; var Params, OwnerData: OleVariant); override;

C++

virtual void __fastcall DoBeforeGetRecords(int Count, int Options, const System::WideString CommandText, System::OleVariant &Params, System::OleVariant &OwnerData);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Datasnap.Provider.pas
Datasnap.Provider.hpp
Datasnap.Provider TDataSetProvider

Description

Generates a BeforeGetRecords event.

The GetRecords method calls DoBeforeGetRecords to generate the BeforeGetRecords event before it fetches data and assembles it into a data packet.

Count is the number of records requested. TDataSetProvider does not use this parameter.

Options indicates whether the data packet should include metadata, whether it should start with the first record, and whether the data packet should be encoded in XML. In TDataSetProvider, DoBeforeGetRecords ignores this parameter.

CommandText specifies either an optional SQL statement that replaces the SQL of an associated query, or the name of a table or stored procedure that replaces the associated table or stored procedure. If Options includes poAllowCommandText, DoBeforeGetRecords sends CommandText to the associated dataset so that it can generate the set of records.

Params contains any parameter values that should be applied to CommandText or to a query or stored procedure before fetching data into a data packet. DoBeforeGetRecords assigns these values to the associated dataset, if appropriate.

OwnerData supplies custom information to the BeforeGetRecords event handler. The event handler can change this value. The returned value is then passed to an AfterGetRecords event handler and then (optionally) returned to the caller of the GetRecords method.

See Also