DBGrid,Bookmarks和SQLite非常慢

时间:2017-08-06 18:36:42

标签: sqlite ubuntu lazarus dbgrid

每次迭代大约需要一秒钟。已添加书签的行可能不是是连续的,那么有更好的方法吗?

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;

0 个答案:

没有答案