Board index » delphi » Current Record in a Query

Current Record in a Query

I will post this one last time, then I'll shut-up.

I have a query that places data into a DBGrid component.  I would like to
show the user what record he is currently on within the grid thusly:
"Record 999 of 999."  However, I can't figure out how to get the current
record number from within the Query/DBGrid.

Any help from you experts would be much appreciated.

 

Re:Current Record in a Query


Message sender : Daniel.Hay...@mci.com

I will post this one last time, then I'll shut-up.

I have a query that places data into a DBGrid component.  I would like to
show the user what record he is currently on within the grid thusly:
"Record 999 of 999."  However, I can't figure out how to get the current
record number from within the Query/DBGrid.

Any help from you experts would be much appreciated.

Re:Current Record in a Query


On 19 Sep 1996 14:19:28 GMT, "Daniel Hayden" <Daniel.Hay...@mci.com> wrote:

Quote
>I will post this one last time, then I'll shut-up.

Me too.

Quote
>I have a query that places data into a DBGrid component.  I would like to
>show the user what record he is currently on within the grid thusly:
>"Record 999 of 999."  However, I can't figure out how to get the current
>record number from within the Query/DBGrid.

The information comes from the query, but how you get it depends on what
kind of database you're using. If xbase, then you'd use the dbiGetRecNo()
function, and if Paradox, use dbiGetSeqNo(). At the same time, if you are
using xbase, and you have an index active, the numbers you see are not
likely to make any sense. The paradox call returns *sequence* number
according to the index (or lack of one), but the xbase call returns an
actual record number which probably has little if anything to do with the
the sequence of records returned by the index.

If you are not using xbase or Paradox, then forget everything I've said.

Alan

Re:Current Record in a Query


Quote
> I have a query that places data into a DBGrid component.  I would like to
> show the user what record he is currently on within the grid thusly:
> "Record 999 of 999."  However, I can't figure out how to get the current
> record number from within the Query/DBGrid.

You could check if DBRECNUM -component would be for any help. Good place
to
look for it is Delphi Super Page.  Yes, source code is included.

:DBRecNum Component
:------------------
:This unit contains the code for the DBRecNum component.
:DBRecNum attaches to a TDataSource and displays the record
:number for DBase and Paradox tables. Unlike similar
:components, DBRecNum responds automatically to changes
:in the DataSource.
:
:                Paul Warren
:Home page: http://haven.uniserve.com/~hg_soft

Other Threads