将Dbgrid中所选择的多行记录进行批量修改,代码如下,不知为何出错?if DBGrid1.SelectedRows.Count>0 then
with DBGrid1.DataSource.DataSet do
begin
for i:=0 to DBGrid1.SelectedRows.Count-1 do
begin
GotoBook(pointer(DBGrid1.SelectedRows.Items[i]));
Edit;
Fields[1].Value:='abc';
end;
Adoquery1.UpdateBatch(arAll);
with DBGrid1.DataSource.DataSet do
begin
for i:=0 to DBGrid1.SelectedRows.Count-1 do
begin
GotoBook(pointer(DBGrid1.SelectedRows.Items[i]));
Edit;
Fields[1].Value:='abc';
end;
Adoquery1.UpdateBatch(arAll);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货