procedure TForm1.BitBtn1Click(Sender: TObject);
begin
adoquery1.Insert;
end;
procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField);
begin
dbedit1.text:=adoquery1.fieldbyname('a').asstring;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
adoquery1.Delete;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with adoquery1 do
begin
close;
sql.clear;
sql.add('select * from a');
open;
end;
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin
adoquery1.post;
dbedit1.Clear;
end;
procedure TForm1.ADOQuery1AfterDelete(DataSet: TDataSet);
begin
adoquery1.Close;
adoquery1.Open;
end;
end.
代码如上,有一个表,表有唯一的一列a