BeforeGetRecords, Active, CloneCursor, FetchOnDemand Example

This example shows how to use the BeforeGetRecords event handler to send the application server information it needs for incremental data fetching. Before fetching the next data packet, the client dataset packages up the key value of the last record so that the application server knows where to begin the next data packet. It also sends some application-specific information, which is stored in Memo1.

void __fastcall TForm1::ClientDataSet1BeforeGetRecords(TObject *Sender, OleVariant &OwnerData)
OleVariant[2] Values;
Values[0] = NULL;
if (ClientDataSet1->Active)
ClientDataSet *CDSClone = new ClientDataSet(Form1);
CDSClone->CloneCursor(ClientDataSet1, true);
// turn off FetchOnDemand so that the clone only
// fetches the last LOCAL record
CDSClone->FetchOnDemand = false;
Values[0] = CDSClone->Fields->Fields[0]->Value;
delete CDSClone;
Values[1] = Memo1->Lines->Text;
OwnerData = VarArrayOf(Values,1);

Кения сафари, противомалярийные таблетки, индивидуальный тур, тур экономическим, бюджетным Сафари , Вопрос Кении Сафари, пляжный отдых,
Kenya Affordable Safaris
GPS location


Popular posts from this blog

TClientDataSet::AppendData and TClientDataSet::BeforeGetRecords