Displaying a Record Number for a Table

Displaying a Record Number for a Table

I use an InterBase database with an alias made in BDE. I want to display the record number for a table when I navigate through the records.

Your solution <>.RecNo always returns –1 because it is a TDataSet.RecNo.

Is there another solution?

There is no such thing as a record number with server-based databases such as InterBase and others like SQL Server and Oracle. This is because these database servers are set-based, not record-based. RecNo only applies to desktop databases like Paradox and dBASE (and clones).

You might be able to “fake” the record number with your table if you have a unique identifier in that table, and that unique identifier is a single column. In that case, you’d do something like this:

 SELECT Count(UniqueIDColumn)FROM MyTableWHERE UniqueIDColumn <= IDValue

where IDValue is the ID value of the current "record." Of course, you'd have to know that with some sort of retrieval SQL statement.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular