begin datasource1.close; adotable1.first; while not adotable.eof do begin if adotable['ziduan']=' 你查询的记录' then break else adotable.next; end; datasource1.open;
两个都差不多append: Adds a new, empty record to the end of the dataset.Edit: Call Edit to permit editing of the active record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit
然后怎么发送sql语句呢? SQL用adoquery组件
取数据: With adotable1 do begin close; tablename :='你的表'; Active :=true; append ;//追加 …… …… post ; refresh; end;
append 是增加数据
s:=ADOTable.FieldByName('字段名').asstring; //取值adotable.edit; //修改
ADOTable.FieldByName('字段名').asstring:= 'fd';
adotable.post;adotable.append; //增加
ADOTable.FieldByName('字段名').asstring:= 'fd';
adotable.post;
datasource1.close;
adotable1.first;
while not adotable.eof do
begin
if adotable['ziduan']=' 你查询的记录' then break
else adotable.next;
end;
datasource1.open;
SQL用adoquery组件
With adotable1 do
begin
close;
tablename :='你的表';
Active :=true;
append ;//追加
……
……
post ;
refresh;
end;
SQLinsert或append这样添加