RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataSetProvider.DoBeforeGetRecords Method

Generates a BeforeGetRecords event.

Pascal
procedure DoBeforeGetRecords(Count: Integer; Options: Integer; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); override;
C++
virtual __fastcall DoBeforeGetRecords(int Count, int Options, const BSTR CommandText, OleVariant Params, OleVariant OwnerData);

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. 

 

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