每次迭代大约需要一秒钟。已添加书签的行可能不是是连续的,那么有更好的方法吗?
ArrYN : Array[Boolean] of String = ('0','1');
procedure TForm1.MarkDone(aYN : Boolean);
var
sqlStr : String;
begin
sqlStr:=
' UPDATE tMaster SET allDone = '+ArrYN[aYN]+
' WHERE anID = '+dbMain.FieldByName('anID').AsString+';';
dbMain.SQL.Text:=sqlStr;
dbMain.ExecSQL;
end;
for i:=0 to dbgMaster.SelectedRows.Count-1 do
begin
dbMain.GotoBookmark(pointer(dbgMaster.SelectedRows.Items[i]));
MarkDone(aYes);
end;