QueryAllRecords and EOF

Peter Zolja

Member²
I have a TOracleDataSet with QueryAllRecords set to false. The user can try to fetch all rows (OracleDataSet.Last) but can also stop the fetching. This all works ok. My question is: What is the best way to know if there are no more records to pull from the database? I tried checking for Eof on AfterFetchRecord but that always returns true (Eof ie). However, checking for Eof in AfterScroll seems to work. I would need of a way to know if I have fetched all the data without having the user scroll to the end.

Thanks for your help.
 
This can only be achieved if you enable the CountAllRecords property. This way the TOracleDataSet will first execute a "select count(*) from ", so that the number of records are known. After that, the actual SQL is executed and records are fetched. The RecordCount property now reflects the total number of records that will be fetched.
 
Back
Top