My Delphi application uses SQLite for its database. My understanding is that the database connection control TFDConnection has a default row count of 50 records. If true, there should only be 50 records displayed in the TDBGrid control on screen at any one time. The next set of 50 (or less) would be shown once you pass the 50th record in the dataset by proceeding to the next or last record.
The problem is my application is apparently loading all the database records (currently 148) at one time which exceeds the default record count using select * from tablename. I have tried to setup a "paging" approach to solve the problem as well using the following:
data.query.last;
TotalRec:=data.query.RecordCount;
PageCnt:=TotalRec div 50;
RecRemain:=TotalRec mod 50;
Then using the following code to get the dataset based on a limit and offset:
data.query.SQL.Text:='select * FROM tablename LIMIT :limit OFFSET :ofs;';
data.query.ParamByName('limit').asInteger:=50;
data.query.ParamByName('ofs').asInteger:=ofs1;
data.query.open;
The variable ofs1 is initially zero but is incremented or decremented by 50. Even this approach is not limiting the dataset to 50.
Any help understanding why this is happening would be very helpful moving forward. Thanks.