将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);