Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004

    Question Unanswered: AutoNumber question?

    I have a question,don't know if it is a silly one.

    Database that I am doing maintenance on, has at least one table that has AutoNumber Field, and I would assume that it assigns a number up per new entry.

    In this case however, it seem that it is increasing numbers logically and then somewhere along the lines users notice that it has jumped a couple of thousand numbers and then from that point is assigns the next one up and so on...

    Is that normal, is that suppose to be happening,is that caused by something that was set and needs to be changed.

    Has anyone come accross that?


  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    Someone deleted a large chunk of records.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Oct 2003
    The only purpose of AutoNumber is to (try to...) automatically assign a unique number that has not been used before and will not be used again. Gaps in the sequence are not only possible, but normal, and should be of no concern.

    Sometimes humans want numbers, such as invoice-numbers, to be handled differently. They are used to numbered paper documents and want to be able to count them and to determine if anything's missing. They also want to be able to re-use numbers. AutoNumber fields, IMHO, therefore should not be used to produce "human-visible" numbers. Separate programmed logic should be used, employing indexes having the "unique values" characteristic to prevent duplication.

    Likewise, and for the same reason, do not use "human visible" numbers as the glue which ties your internal record-structures together. "Constants aren't." "Unique values, in the human world, aren't." Humans accustomed to manual filing systems like to embed meaning into their choice of numbers. All of these are quite tolerable to endlessly-adaptable, intelligent humans; but they are Bad Things to inflexible computer systems. The computer cannot exert absolute-control over human-visible numbers; it can control its own internal affairs. Unique internal-only IDs (with enough redundant information to detect and control inevitable errors) can be generated by AutoNumber, but the actual values should mean-nothing to you or any human. Map the "human" identifiers to inflexible internal keys, and never reveal those keys to the outside world.
    Last edited by sundialsvcs; 09-02-04 at 09:35.
    ChimneySweep(R): fast, automatic
    table repair at a click of the

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts