kbmmemtable 查询
procedure TForm6.btn4Click(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
ShowMessage(fld_Value.AsString);
//还可以用FindKey实现,结合索引速度更快
// kbmMemTable1.IndexFieldNames:='Id';
//
end;