Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > C/C++
Register

Reply
 
LinkBack Thread Tools
Old 16.06.2009, 21:16   #1
Младенец
 
Join Date: 06 2009
Location: Bulgaria
Posts: 1
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default BCB Help

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!
Reply With Quote
Old 24.06.2009, 11:26   #2
Дошкольник
 
Join Date: 03 2003
Location: 2A
Age: 49
Posts: 104
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Quote:
Originally Posted by elisgugu View Post
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
Reply With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 03:16.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.