ADO datasets support the common dataset feature of using bookmarks to mark and return to specific records. Also like other datasets, ADO datasets let you use filters to limit the available records in the dataset. ADO datasets provide an additional feature that combines these two common dataset features: the ability to filter on a set of records identified by bookmarks.
procedure TForm1.Button1Click(Sender: TObject); var BM1, BM2: TBookmarkStr; begin with ADODataSet1 do begin BM1 := Bookmark; BMList.Add(Pointer(BM1)); MoveBy(3); BM2 := Bookmark; BMList.Add(Pointer(BM2)); FilterOnBookmarks([BM1, BM2]); end; end;
void __fastcall TForm1::Button1Click(TObject *Sender) { TBookmarkStr BM1; TBookmarkStr BM2; BM1 = ADODataSet1->Bookmark; BMList->Add(BM1); ADODataSet1->MoveBy(3); BM2 = ADODataSet1->Bookmark; BMList->Add(BM2); ADODataSet1->FilterOnBookmarks(ARRAYOFCONST((BM1,BM2))); }
Note that the example above also adds the bookmarks to a list object named BMList. This is necessary so that the application can later free the bookmarks when they are no longer needed.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|