Counting Rows in DBGrid. How do I do that? 
Author Message
 Counting Rows in DBGrid. How do I do that?

If a DBGrid is linkt to a Table using a secondary Index, how do I find
out how many Rows in the DBGrid contain data?
How do I find out (during runtime) if the DBGrid is empty?

Thanks in advance.

\/\/illem



Sun, 25 Mar 2001 03:00:00 GMT  
 Counting Rows in DBGrid. How do I do that?

Willem,

Not sure if I understand the question, but I am assuming that your grid is
attached to a detail table which is linked to a master table.

When a grid is attached to a table, then whatever is showing in the grid is
exactly what the table is looking at.

Thus, you can look at the tables .recordcount property to see how many records
the table currently holds.

The .recordcount property does not necessarily tell you how many records are in
the entire table, it tells you the current records that it sees.  So, if you
have a detail table linked to a master on field 'item number', and the master
is looking at 'item number 1' then only the records whose item number = 1 will
show in your detail table, and the .recordcount will reflect this.



Sun, 25 Mar 2001 03:00:00 GMT  
 Counting Rows in DBGrid. How do I do that?

Quote:
>How do I find out (during runtime) if the DBGrid is empty?

Try:

If MyTable.IsEmpty then ShowMessage('Is empty');

(MyTable is linked with DBGrid)



Mon, 26 Mar 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Count Rows in DBGrid

2. row in dataset from row in dbgrid

3. Anyone done D2->ODBC->Personal Oracle?

4. blank screen when doing graphics in tp for dos 7

5. What am I doing wrong...

6. Anyone doing 3-tier (n-tier) Client Server???

7. checking for correct data entry or preventing that it can be done

8. Can this be Done?

9. Can this be done by Sql

10. tquery - when done?

11. Anyone done D2->ODBC->Personal Oracle?

12. D3/BDE multi-threaded apps : Anyone done it ?

 

 
Powered by phpBB® Forum Software