Trouble with Fetchall
Posted: Thu 25 Nov 2010 14:02
Hi
I think I am having trouble with the Fetchall property.
I have set the Fetchall to False and FetchRows to 100.
I have counted number of records in the table beforehand with a select Count(*).
With this:
Progressbar.max := queryCount.Fields[0].asInteger
MSQuery1.open;
while not MSQuery.eof do
begin
advanceProgressBar
Do something with result
MSQuery.next
end
it seems to me, that all records are fetched before I start traversing the dataset.
What I want to acheive is:
- Get the first 100 records
- Start traversing them, handling the values
- Update a progressbar
- Get the next 100 records as needed....
I have been searching the forum for answers on this but couldnt find any. I did however stumble on someone asking how to stop fetching once 500 records are retreived... In addition to above question, how do I figure out when 500 records are retreived?
Kind regards
Jens Fudge
I think I am having trouble with the Fetchall property.
I have set the Fetchall to False and FetchRows to 100.
I have counted number of records in the table beforehand with a select Count(*).
With this:
Progressbar.max := queryCount.Fields[0].asInteger
MSQuery1.open;
while not MSQuery.eof do
begin
advanceProgressBar
Do something with result
MSQuery.next
end
it seems to me, that all records are fetched before I start traversing the dataset.
What I want to acheive is:
- Get the first 100 records
- Start traversing them, handling the values
- Update a progressbar
- Get the next 100 records as needed....
I have been searching the forum for answers on this but couldnt find any. I did however stumble on someone asking how to stop fetching once 500 records are retreived... In addition to above question, how do I figure out when 500 records are retreived?
Kind regards
Jens Fudge