TMSGridDatabaseAdapter PageMode

I am testing TMS Grid connecting a SQLite DB using TMSGridDatabaseAdapter. I noticed that the full dataset is loaded into the grid (I am using a big DB, 500k rows). Loading the whole dataset slow down the grid significantly.

There is a property like PageMode that can be used with TMSGridDatabaseAdapter or any other option to load only only the rows from the connected dataset that are visible?
1 Like

Hi, 


The TTMSFNCGridDatabaseAdapter is specifically designed to only load the number of visible rows in the grid, and dynamically load data as scrolling occurs in the grid. We have re-tested this here with a TClientDataSet and have attached a code sample to demonstrate this:

http://www.tmssoftware.net/public/Demo_DBAdapter.zip

Please provide additional details or a sample that demonstrates this issue so we can investigate exactly what is going wrong.

I am using lazarus..

Hi, 


We have recreated the sample under Lazarus with TMemDataset, which also loads fast
http://www.tmssoftware.net/public/Demo_DBAdapter_LCL.zip

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;


Information to contact us by email for support can be found here:

http://www.tmssoftware.com/site/support_mail.asp  You could send some download link in the email so we can check.

I can send you my test project but the sqlite db is big. Do you need the sqlite db too or you can create it by yourself?

Having the large file (by download, for example via https://wetransfer.com/) would be convenient to be able to test it faster.

Sorry Bruno, but which tms mail should I use?

Please use the form at:

http://www.tmssoftware.com/site/support_mail.asp