kbmMemTable中怎麼根據UniqueRecID定位到對應的記錄

function TForm5.LocateUniqueRecID(aDataSet: TkbmMWCustomClientQuery; AID: TkbmNativeInt): Boolean;
var
  i:Integer;
  ARecordID:TkbmNativeInt;
  pRec: PkbmRecord;
  ARecords: TkbmList;
begin
  result:=False;
  ARecords:=aDataSet.Common.Records;
  for i := 0 to ARecords.Count - 1 do
   begin
        pRec := PkbmRecord(ARecords.Items[i]);
        if pRec = nil then
           Continue;
        if pRec.UniqueRecordID=AID then
        begin
              ARecordID:=pRec.RecordID;
              while not ADataSet.Eof do
              begin
                 if aDataSet.RecordID=ARecordID then
                 begin
                   Result:=True;
                   Break;
                 end;
                 ADataset.Next;
              end;
        end;
if result then Break;
end; end;

 有朋友問我這個問題,寫到這裏了!spa

相關文章
相關標籤/搜索