Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 5 Jahren, 2 Monaten
Letzter Beitrag:
vor 4 Jahren, 9 Monaten
Beteiligte Autoren:
Geert Debruyne_, kimor, Fabrice Harari

Migrate numeric value to automatic identifier in HF

Startbeitrag von Geert Debruyne_ am 01.02.2013 16:11

We have a problem: we had a file with a unique key: an integer value.
We changed the analyses and made that field a automatic identifier. Generating the analyses.. everything seems to be fine.
But... if you want to add records to the file, the automatic ID start at 1!!!
So we get duplicate errors... and can not add records anymore.

Any idea how this can be solved?

Thanks for any help
Geert

Antworten:

Hi Geert

look in the help file for the hAdd function. You'll see that there is an option to FORCE the autoID value...

So in your case, you need to:
- find what is the greatest existing value in your file (by example 10275)
- create a "false" record doing an hadd with the value set inn the autoID field at 10276, and with the force autoID option
- delete the same record
- your next added record will be at 10277

Best regards

von Fabrice Harari - am 01.02.2013 16:24
Fabrice,
thanks, it works

Geert

von Geert Debruyne_ - am 06.02.2013 09:03
Hi, I have a problem with this and can't get it solved.
Should it look like this?:
HAdd(Behorigheter, hForceIdAuto)

Should the hForceIdAuto option be taken away or not after adding an deleting a new record?
I tried both and after adding a new record again, it still wants to add #0, not 238 as in my case...
Adding a new record thru WDMAP also gives me #0...
Is there any other file other than .fic and .ndx that holds the counter?
How to solve this?

If I add the number myself in the error window I can keep adding, but for obvious reasons that doesn't work..

Also:
Suddenly when I read/added/deleted records windev wanted to use the files in a subdirectory.
The analysis shows correct and can be read with WDMAP.
I managed to fix this in HF Control Center, I think...(the physical location of each file). Now I see that the other locations are back. Why does this happen?

Regards,
Kim

von kimor - am 15.07.2013 12:28
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.