Problems with primary key

Keidy

Registered User.
Local time
Today, 04:09
Joined
Dec 5, 2006
Messages
26
:D Hi! I have a table that the primary key is autonumeric. I trying to do a form to add data to tnis table... but now i erase som rows of the table, and now the primary key jump to values. what can i do to restart the primary key to have the correct order without jumpping number? please :confused:
 
autonumber

Actually the primary key autonumeric is behaving exactly how it should. Each time a record is added the number increases. Upon deleting records the autonumeric continues on where it had left off before the deletion.

There have been many examples of resetting an autonumeric value in this forum. Use the search function here and you will see many examples. If you still need help let us know.
 
You should never EVER place a requirement other than UNIQUE (and perhaps the fact that it is a LONG INTEGER, when establishing relationships to foreign keys) on an AUTONUMBER field.

If the number MUST have the property of MONOTONICALLY increasing, it cannot be an autonumber.

Rethink your requirements. Search this forum for "Autonumber" topics to see how often this comes up - and how often we have to guide folks away from abuse of autonumbers.
 

Users who are viewing this thread

Back
Top Bottom