SQLite User Forum

Disablecontrols dos not affect on review speed for FDTable or FDQuery with lookup field on Delphi Embarcadero 10.2 or 11
Login

Disablecontrols dos not affect on review speed for FDTable or FDQuery with lookup field on Delphi Embarcadero 10.2 or 11

(1) By aalikazem on 2022-06-28 07:45:22 [link] [source]

I have a FDTable with some lookup fields with thousands of records. when I review FDTable with this code:

FDTable1.AutoCalcFields:=false;
FDTable1.DisableControls;
FDTable1.First;
while FDTable1.Eof<>true do
begin
  // some code....
  FDTable1.Next;
end;
FDTable1.EnableControls;
FDTable1.AutoCalcFields:=true;

It consume a lot of time. When I remove lookup field from table , this cod run very fast.


It is necessary to mention that, My database is SQLite and this code run with database IV and ADOTable very fast for table that contain lookup fields. How can I solve this problem.

(2) By Stephan Beal (stephan) on 2022-06-28 09:02:50 in reply to 1 [link] [source]

How can I solve this problem.

You'll need to contact the folks responsible for the Delphi binding you're using. There is not one line of actual sqlite3 code (neither SQL nor C) in the example you've shown, only some mysterious wrapper authored and supported by a 3rd party.

(3) By Ryan Smith (cuz) on 2022-06-28 09:52:19 in reply to 1 [source]

To add to what Stephen said, there's not even enough information for a Delphi person to form an opinion on.

What type is FDTable? Is it ADO, or Firemonkey, or TSQLDataset?
Do you have an event that fires on seeing a new row? If so, what happens inside that event? etc.

If/when you post this on a Delphi forum, make sure to show a lot more of your code, especially where the DB object gets declared and also instantiated/opened.

All we can tell you is that SQLite as an Engine will not slow down in the way that you describe, so whatever is wrong will be in your code or the Delphi wrapper object.