Board index » delphi » RecNo is not working in MSAcess

RecNo is not working in MSAcess

I have a query (or table) using MSACCESS and RecNo always returns -1.
What I am doing wrong ? Is there other way to access the current position
(need it for a calc field).

Thanks

 

Re:RecNo is not working in MSAcess


SQL databases do not posess the concept of a record-number and do not
supply them to your application.  The value is always -1 to indicate
that a record number has not been supplied.

The current-position can be remembered and returned-to, using bookmarks,
but that value is a "magic cookie" and it has no useful or predictable
value.

To determine the current position in a recordset, you must determine it
yourself.

This might be a good application for a custom component-class descended
from TQuery or TDataset.  Methods can be overridden appropriately to
maintain a counter.  In fact, this requirement is probably so common by
now that you'll be able to quickly find a freeware component where
someone has already worked it out and given it away.

Quote
>Juan wrote:

> I have a query (or table) using MSACCESS and RecNo always returns -1.
> What I am doing wrong ? Is there other way to access the current position
> (need it for a calc field).

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:RecNo is not working in MSAcess


Access dosen't use record numbers.  I'd be supprised if *ANY* database
engine that supported access could use record numbers for access tables.
Access *DOES* support bookmarks.  Try using one of those instead.

--
Roy Owen
Servant PC Resources, Inc.

Quote
"Juan" <gj...@email.com> wrote in message

news:8jvn24$d724@bornews.borland.com...
Quote
> I have a query (or table) using MSACCESS and RecNo always returns -1.
> What I am doing wrong ? Is there other way to access the current position
> (need it for a calc field).

> Thanks

Re:RecNo is not working in MSAcess


Quote
On Wed, 5 Jul 2000 13:29:32 -0300, "Juan" <gj...@email.com> wrote:
>I have a query (or table) using MSACCESS and RecNo always returns -1.
>What I am doing wrong ? Is there other way to access the current position
>(need it for a calc field).

Nothing. Access and practically all other SQL databases don't support
the concept of record numbers. You have to use a field with an unique
contents instead.

Reagrds from Germany

Franz-Leo

Re:RecNo is not working in MSAcess


Record numbers are not available when using Access. If you need to return to
a particulary record use a bookmak or the primary key.

--
Bill Todd (TeamB)
(Questions received via email cannot be answered.)

Other Threads