Welcome! Log In Create A New Profile

Advanced

Reset Auto ID start point

Posted by DarrenF 
DarrenF
Reset Auto ID start point
October 22, 2008 03:12PM
Hi all,

Short of recreating the HF file, is there a way to reset the start point of Auto ID's back to 1?

Cheers...

BLS
Re: Reset Auto ID start point
October 22, 2008 03:21PM
Not sure , but I think reindexing should do the Job.
WDMap/Tools/Reindexing/with Deletion.
Bjoern
Fabrice Harari
Re: Reset Auto ID start point
October 22, 2008 04:32PM
Hi all..

the good news is that for once you are wrong... Imagine the mess if the autoID could change in any way due to reindexing :-)... The links between the files would be a mess...

The last used autoID is stored in record 0 of the fic, so reindexing will not change it...

Now, for the original question, you cannot reset the ID to 1 if any record remains in the file (or you would get an error on each record creation afterwards), therefore recreating the file is the logical way of doing it...

If you really CAN'T do it that way, you can also write the first new record using the option hForceIDAuto (or hSetIDAuto, I can't remember), but hat will have to be done at the first record creation, which is not always practical to do

best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
DarrenF
Re: Reset Auto ID start point
October 22, 2008 06:25PM
Hi,

Thanks for taking the time :spos:

Bjoern, you're probably thinking of reclaiming rows that have been marked for deletion?

Fabrice, thanks for your suggestion, it might just work :cool:

I realise the implications of resetting this auto ID back to 1, and in my case it's okay as I'm experimenting with an initial load of a product file from a supplier's XLS file and just want the ID's to start from the beginning after a few experiments have taken place smiling smiley

Thanks again...
Arie
Re: Reset Auto ID start point
October 22, 2008 07:50PM
If you don't mind losing that experimental data, you could just delete the file.
If you set our project-settings to "auto create files if not found when they are opened" than that's all you have to do (WD12)

Arie
DarrenF
Re: Reset Auto ID start point
October 26, 2008 12:31AM
All,

In my case HCreation is the answer. It automatically deletes and recreates the file while resetting the record number and auto ID... and it's lightening fast (compared to reading and deleting each row of the table) :xcool:

Just thought I'd let you know...

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: