Results 1 to 4 of 4

Thread: ANNOYING AutoNumber Problem!!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Bryan, Texas
    Posts
    27

    Post

    Ok... I have a database and a program which views the fields in the database. I am using an access 2000 database, ADO, and Jet.OLEDB.4.0. Each entry in the table has an ID number which I am automatically assigning with AutoNumber. The problem is that when I delete a record(for example say that it had ID "15"). The next record that I add will have ID "16", without assigning a record to ID 15. How do I prevent this?
    Thanks In Advance....


    ------------------
    Mitchell Hayenga
    [email protected]

  2. #2
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123

    Post

    You can't. Once an autonumber has been used, then it has been used - end of story.

    Not what you want to hear but the truth isn't always pleasant!!!

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    After you compact the database, the autonumbers will again begin at the next available number.

    If you delete all records in a table, then compact, it will restart at 1

    If you delete the last 3 numbers, then compact, it will restart at the number of the 1st one

    hope that makes sense....try it for yourself if it doesn't

    Tom

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Bryan, Texas
    Posts
    27

    Post

    Thanks, I'll have to try that.....

    ------------------
    Mitchell Hayenga
    [email protected]

Posting Permissions

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



Click Here to Expand Forum to Full Width