Quote:
Originally Posted by elisgugu
Hello!
I am not very good at BCB and I want to ask you that question:
Let`s imagine that we have a TIBQuery and we do something and we have some rows! I want to take the count of them and for each of them to check
it`s value whether or not is equal to some value char *buf for example?
I know that I have to do that:
IBQuery->True;
IBQuery->FetchAll();
for(i=0;i< RecordCount;i++){
fetch the value from each row in the field("segment") and check and compare
with char * buf
}
10x a lot!
|
TIBQuery.RecordCount tells you only how many rows of the result set have been fetched so far, RecordCount will only be equal to real records count from database after all the records have been visited.
1. Use "SELECT COUNT() ..." like queries to fetch real records count
2. Call IBQuery.Last, before using RecordCount
3. If you need to operate with all records:
while not IBQuery.Eof; do
......
done