Board index » delphi » TTable.ClearFields and AutoIncrement-Fields !!!

TTable.ClearFields and AutoIncrement-Fields !!!

Problem:
--------

How can I set back an autoincrement-field (Value 1)
in a paradox 5 table in Delphi 1.0 ????

Thanx,
   Werner

-------------------------------------
  Ing. Werner J. J. Weiss
  http://members.ping.at/scorpion/

 

Re:TTable.ClearFields and AutoIncrement-Fields !!!


Ing. Werner J. J. Wei? <w...@writeme.com> wrote ...

Quote
> How can I set back an autoincrement-field (Value 1)
> in a paradox 5 table in Delphi 1.0 ????

I don't think it's possible, even with Level 7 tables.
I've never seen it done, nor mention made of this
facility in the BDE restructuring docs.  My instinct
is that there's good reasoning behind not supporting
this.  I can imagine a heap of range-based code
breaking if all of a sudden records appended to
a table (with autoincrement key) don't end up being
in sequential order, because the BDE has been
clever, gone back and plugged the gaps left by
deleted records.

Re:TTable.ClearFields and AutoIncrement-Fields !!!


Ing. Werner J. J. Wei=DF wrote:

Quote
> =
> Problem:
> --------
> =
> How can I set back an autoincrement-field (Value 1)
> in a paradox 5 table in Delphi 1.0 ????
> =
> Thanx,
>    Werner
> =
> -------------------------------------
>   Ing. Werner J. J. Weiss
>   http://members.ping.at/scorpion/

My understanding is that if you wish to twiddle with an autoincrement
field, then it shouldn't be 'auto'.

-- =

-----------------------------------------
Software Services - Making Windows Scream
http://www.invsn.com/softserv/
bry...@thevision.net
-----------------------------------------

Re:TTable.ClearFields and AutoIncrement-Fields !!!


In article <3314C6E2.2...@thevision.net>, Bryan Valencia
<bry...@thevision.net> writes

Quote
>Ing. Werner J. J. Wei? wrote:

>> Problem:
>> --------

>> How can I set back an autoincrement-field (Value 1)
>> in a paradox 5 table in Delphi 1.0 ????
>My understanding is that if you wish to twiddle with an autoincrement
>field, then it shouldn't be 'auto'.

I want to do this too.  Its a very reasonable thing to do.  You put some
test data into a table and then use 'empty' to clear it out.  You expect
the autoincrement field to go back to zero.  Its not an off thing to
want to do !

--
Alan Rogerson

Re:TTable.ClearFields and AutoIncrement-Fields !!!


Quote
>Problem:
>--------

>How can I set back an autoincrement-field (Value 1)
>in a paradox 5 table in Delphi 1.0 ????

I've found that if you change the field to an integer, save the table,
then change it back to a + autoincrement then the counter is reset.  It
works for emptied tables.
--
Alan Rogerson

Re:TTable.ClearFields and AutoIncrement-Fields !!!


Quote
Alan Rogerson wrote:

> >Problem:
> >--------

> >How can I set back an autoincrement-field (Value 1)
> >in a paradox 5 table in Delphi 1.0 ????

> I've found that if you change the field to an integer, save the table,
> then change it back to a + autoincrement then the counter is reset.  It
> works for emptied tables.
> --
> Alan Rogerson

You can also empty the table, and then pack it. I use DBD, but I guess
you could do it programmatically.
--
Trey Campbell
E-mail at campb...@softdisk.com
Home page at http://www.softdisk.com/customer/campbell

Other Threads