Subject Re: [IBO] TIB_Grid.RowCount ?
Author Helen Borrie (TeamIBO)
At 01:21 AM 11-02-02 +0100, you wrote:
>I use D3/FB/IBO3.
>
>In a master/detail form I need to know the number of the detail rows
>displayed for the current master record.
>
>I was hoping to find a property like TIB_Grid.RowCount, but I can find
>nothing of the sort.
>
>I could issue a SQL command like
>
>select count(*) from detail_table where
>detail_table.cod_itm=master_table.cod_itm
>
>but - er - I have no idea how I can bring the result into a Delphi
>variable...

Use Dataset.RecordCount to get a count of the number of committed rows that met the current search criteria when the current transaction started. If you want to maintain a client-side count between refreshes, use a local counter.

The cost of bringing count(*) across to the client is not worthwhile, since it is only a snapshot of the transaction context in which it was submitted. Count(*) is very expensive in FB/IB if the table has a lot of rows.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com