Go Back   AKB Forums > Technical sections > Languages, Compilers, Interpreters > C/C++

Reply
 
Thread Tools

BCB Help
Old Jun 16, 2009, 20:16   #1
Младенец
 
Join Date: Jun 2009
Location: Bulgaria
Posts: 1
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 Jun 24, 2009, 10:26   #2
Дошкольник
 
Join Date: Mar 2003
Location: 2A
Posts: 104
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

« sexy progress bar | - »
Thread Tools



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

All times are GMT. The time now is 00:35.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.