Hi there,
I've got a TZQuery connected with a TDatasource which is connected to my TRXDBGrid(same as TDBGrid with many functions). My query brings from my database about 300.000 records and as they are enough when I open my query to bring the records to my DBGrid I have changed the FetchRow to 1000 in order not to wait too long. I have also added a button to my form with the title Total Count which brings me the number of Records in my DBgrid. In that button (SBRecordsCount) when I press it, the caption changes and shows the record count.
SBRecordsCount.Caption:= 'Total: ' + inttostr(MyQuery.RecordCount);
With the above code the recordcount is 1000 which is the number of the fetched rows something which I expected. So I changed it to
MyQuery.last;
MyQuery.first;
SBRecordsCount.Caption:= 'Total: ' + inttostr(MyQuery.RecordCount);
The problem is that now that is too slow and sometimes it takes too much time to bring the number (more that 5 minutes) which is not logical. Is there any other way to load the record count somewhere else (memory) in order to take that number quicker?
Thank you, in advance.