RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomProvider.DoBeforeGetRecords Method

Generates a BeforeGetRecords event.

Pascal
procedure DoBeforeGetRecords(Count: Integer; Options: Integer; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); virtual;
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. If Count is –1, all records are requested. 

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. For details, see the GetRecords method. 

CommandText specifies 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. This parameter is ignored if the Options property does not include poAllowCommandText or if the provider does not have an Options property. 

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. 

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. 

As implemented in TCustomProvider, Count, Options, CommandText, and Params are ignored. Descendant classes can apply these values before generating the BeforeExecute event. 

 

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