Board index » delphi » How do I get the rowcount of a DBGrid.?

How do I get the rowcount of a DBGrid.?


2004-10-12 12:05:23 AM
delphi131
Is this a value or do I have to go step and count the number of records.
Cheers SteveW
 
 

Re:How do I get the rowcount of a DBGrid.?

"Steve Warburton" <SteveNospam>writes
Quote
Is this a value or do I have to go step and count the number of records.

You can call the Last method of the dataset and test the RecordCount. Or you
can do a separate query using "Select count(*) from ..." to get the number
of records.
HTH
Woody (TMW)
 

Re:How do I get the rowcount of a DBGrid.?

"Steve Warburton" <SteveNospam>píše v diskusním příspěvku
Quote
Is this a value or do I have to go step and count the number of records.

Cheers SteveW

The maximum number of rows in a DBgrid
(do NOT confuse with number of records
in the table) can be obtained by inspecting
the BufferCount property of the underlying
dataset.
The actual number of rows in the grid is
equal to the lower of two counts:
a) Dataset.BufferCount
b) Number of records in the dataset
(Dataset.RecordCount in datasets
that support RecordCount property)
Roman
mail: XXXX@XXXXX.COM
URL: www.rksolution.cz