PDA

Click to See Complete Forum and Search --> : ANNOYING AutoNumber Problem!!!


mhayenga
Feb 5th, 2000, 06:23 AM
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
mitch@hayenga.com

Michael
Feb 5th, 2000, 09:07 AM
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!!!

Clunietp
Feb 6th, 2000, 06:09 AM
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

mhayenga
Feb 6th, 2000, 10:37 AM
Thanks, I'll have to try that.....

------------------
Mitchell Hayenga
mitch@hayenga.com