It is fast but I cannot check if the grid loads everything on memory or not.
So, my scenario is.
I am working with sqlite doing my tests with a sample DB with 1 table, 50 columns, 500k rows file of 180 MB approx).
My SQLQuery1 is "select * from TEST", TEST is the only table in my test DB.
I put 2 buttons on my form, button 1 swith Active property of TMS db adapter, while button 2 switch active property of SQLQuery1 (see code below).
If I switch adapter active property to true in design time, everything works fine, grid is loaded instantly and seems that only few rows are loaded (correct).
Application starts with query and adapter active property set to False.
At runtime:
- if I click on button2 no memory usage is highlighted, and query is acttivated/deactived instantly;
- if I click on button1: the first time it takes seconds to load the table and if I check memory used by my app it seems that all the DB is loaded in memory (memory usage grows to the file size of DB). Second time I click on button1 (dbadapter active:= false) the app stucks.
I could send you a sample project, but how?
procedure TForm1.Button1Click(Sender: TObject);
begin
TMSFNCGridDatabaseAdapter1.Active:= not TMSFNCGridDatabaseAdapter1.Active;
if TMSFNCGridDatabaseAdapter1.Active then
button1.Caption:= 'adapter active'
else
button1.Caption:= 'adapter NOT active';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
SQLQuery1.Active:= not SQLQuery1.Active;
if SQLQuery1.Active then
button2.Caption:= 'query active'
else
button2.Caption:= 'query NOT active';
end;