RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataSetProvider.InternalGetRecords Method

Provides the underlying implementation of the GetRecords method.

Pascal
function InternalGetRecords(Count: Integer; out RecsOut: Integer; Options: TGetRecordOptions; const CommandText: WideString; var Params: OleVariant): OleVariant; override;
C++
virtual __fastcall OleVariant InternalGetRecords(int Count, int RecsOut, TGetRecordOptions Options, const BSTR CommandText, OleVariant Params);

The GetRecords method calls InternalGetRecords to assemble a data packet after calling DoBeforeGetRecords to apply the CommandText and Params and generate a BeforeGetRecords event. InternalGetRecords calls CreateDataPacket to create a data packet that reflects the current property settings of the provider. It then generates an OnGetData event. 

Count indicates the number 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 the specified number of 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 can include grMetaData (include metadata), grReset (start providing records with the first one in the dataset), and grXML (encode the datapacket in XML rather than as an OleVariant) or grXMLUTF8 (same as grXML but use UTF8 to encode extended characters). 

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. 

Params specifies any parameter values that should be applied to CommandText or to an associated query or stored procedure. If the provider is associated with a TTable, Params specifies field values that filter the result set. On exit from GetRecords, Params returns any output parameters. 

Records are returned as a data packet in a Variant.

Note: If the DataSet property is not set, InternalGetRecords raises an exception.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!