Re: Strange problem

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 07/14/04


Date: Tue, 13 Jul 2004 20:58:07 -0500

On 13 Jul 2004 06:23:55 -0700, "jason" <jason@no-replies.com> wrote:

>I am using Delphi 6 Enterprise (with the latest updates).
>I am connected via a TADOTable to an access database table.
>My table has approx. 150 records in it, with an autoincrementing
>id-field, called ArchiveID as the primary key.
>
>When I execute the following code:
>
>if tblArchive.Active = false then
> tblArchive.Open;
>tblArchive.Last;
>
>showmessage(tblArchive.fieldbyname('ArchiveID').asstring);
>
>Now instead of getting a message showing '150' I am getting a message showing '94'. I checked in my table and I have sequencial records from 1 to 150.
>
>Why when I call the last procedure does it not position itself on the last record in the table, in my case the record with an ArchiveID=150??

If you are using a TadoTable set the Indexname to the index of your Primary key
field to order by that field

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: Can and Cant insert using DAO on SQL Server linked table
    ... is set to Yes for the Primary Key which is autoincrementing. ... Mark ... >> God Bless, ...
    (microsoft.public.sqlserver.security)
  • Re: primary key autoincrement question.
    ... properties under column properties in order to set it to false. ... but still in my vb.net app when i add record the IDNO field still ... >it (if not right click and set primary key) ... >autoincrementing set it to false and there you go:) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: primary key autoincrement question.
    ... select your id make shure that there is a key symbol next to ... it (if not right click and set primary key) ... this makes it the primary key the identity is something else --> ... > add a record this field is autoincrementing. ...
    (microsoft.public.dotnet.languages.vb)