Wednesday, May 13, 2009

TClientDataSet::GetNextPacket

TClientDataSet::GetNextPacket
Retrieves the next block of records from the application server.

int __fastcall GetNextPacket(void);

Description


Call GetNextPacket to retrieve the next sequential block of records from the application server. To specify the maximum number of records to return in a packet, set the PacketRecords property before calling GetNextPacket. A packet is appended to those records already stored in the Data property.

GetNextPacket returns the number of records added to Data. If the return value is 0, the client application has already received all available records from the application server.

Warning:
If the client dataset uses a stateless application server, you must use a BeforeGetRecords event handler to ensure that the data packet returns the correct set of records.

TClientDataSet
TClientDataSet implements a database-independent dataset.
Unit


dbclient

Description
TClientDataSet encapsulates a database-independent, distributed dataset. A client dataset can be used as a
-Fully-functional, standalone, flat-file dataset for single-tiered database applications. When used in this manner, an application uses the client dataset to read from and write to a user’s hard disk directly, without accessing a database engine.
-Client dataset in the client application portion of a multi-tiered database application.

NB:The two functions described above are not mutually exclusive. A multi-tiered application can be designed to support the option of working with data off-line, using the “briefcase” model. On site, the application uses TClientDataSet to communicate with the application server’s data provider. When a user works off site, the client dataset writes a snapshot of the data to the hard disk. The application works with this snapshot off site, with the client dataset acting as a flat-file dataset in a single-tiered application.

The client dataset can communicate with a data provider directly by calling the provider component’s methods. When used in a client application as part of a multi-tiered application, the client dataset passes all calls to the provider through the remote data module’s IAppServer interface.

No comments:

Post a Comment