kbmmemtable 删除数据

procedure TForm6.btn5Click(Sender: TObject);
var
  fld_Id:TIntegerField;
  fld_Value:TStringField;
  fld_Time:TDateTimeField;
begin
  //删除
    cxGrid1DBTableView1.DataController.DataSource := ds1;
  ds1.DataSet := kbmtbl1;

  with kbmtbl1 do
  begin
      Open;
//    fld_Id:=TIntegerField(FieldByName('Id'));
//    fld_Value:=TStringField(FieldByName('Value'));
//    fld_Time:=TDateTimeField(FieldByName('Time'));
    if Locate('Id',5,[]) then
    begin
      Delete;
      UpdateIndexes;
    end;
  end;
end;

posted @ 2017-03-12 10:27  夏天的西瓜君  阅读(299)  评论(0编辑  收藏  举报