Board index » delphi » autoincrement field

autoincrement field

Exist any way to put an autoincrement field to zero without reCreate the
Table?
Thanks in advance
 

Re:autoincrement field


Empty the table. Restructure the table and change the field to LongInt.
Restructure the table and change the field type back to AutoInc.

Bill
--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Re:autoincrement field


Quote
>Exist any way to put an autoincrement field to zero without reCreate the
>Table?

No you have to recreate the table.

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

Re:autoincrement field


hpc p?e ve zprv <3744978B.232DC...@netverk.com.ar>

Quote
>Exist any way to put an autoincrement field to zero without reCreate the
>Table?
>Thanks in advance

few weeks ago I responded similar question asking
how to reset the autoincrement number to any
chosen value (to 1000 in particular) in Paradox
tables, so I repost my answer again.

Quote

Well, it is not particularly clean, but it will work:
Last used autoinc value is stored within DB file
as longint at offset $49. Setting this longint
to 999 (by direct write to DB file) will result
in that 1000 will be used as next autoincrement
value.
Cleaner, but much harder way to achieve the same thing
would be to change autoincrement field type to long integer,
insert record with field value equal to 999, change
long integer back to autoinc and delete the inserted record.
<<
--
Roman
(please remove 'stopspam' in header when replying)
mail: i...@rksolution.cz
URL: www.rksolution.cz

Re:autoincrement field


I don't know what TeamB I'm sure knows, but for some unknown reason I've
been able to just change the autoIncrement field to a longInt and back again
and that seems to have worked just fine with no dataloss or corruption. I
did this 3 times on a paradox 5.0 table with over 800,000 records in it...

Hope this helps...

Quote
hpc <hpco...@netverk.com.ar> wrote in message

news:3744978B.232DCEDE@netverk.com.ar...
Quote
> Exist any way to put an autoincrement field to zero without reCreate the
> Table?
> Thanks in advance

Other Threads