ID Number Question

  • Thread starter Thread starter Gordon
  • Start date Start date
G

Gordon

VB.Net Standard, Win2k Pro, MS Access 2000 w/all patchs up to date.

I have a tmp table that is emptied after application execution. It has an
autonumber ID primary key. How do I get the ID key to reset to 0 after each
use?

Thanks

GG
 
Compact the database.

Of course, it shouldn't matter. The only point of an Autonumber field is to
provide a (practically guaranteed) unique value that can be used as a
primary key. 436, 437, 438 serves that purpose just as well as 1, 2, 3.
Seldom, if ever, should you even be aware of the value of the Autonumber
field.
 
Gordon,

In addition to the very good advice from Doug and Larry, it occurs to me
that you may be using this tmp table (requiring an AutoNumber beginning with
1) as a way to provide row or record numbers for use by your users. If so,
you might want to check out MVP Stephen Lebans' techniques for doing this
at:

http://www.lebans.com/rownumber.htm
 
Hi Gordon,

After you've deleted all the records, compact and repair the database.

As a general rule, human beings should never see an autonumber value nor
should a developer care what its value happens to be. It exists to provide
uniqueness when used as a Primary Key. Use for any other purpose will
almost always lead to problems.

HTH
 
Gordon said:
VB.Net Standard, Win2k Pro, MS Access 2000 w/all patchs up to date.

I have a tmp table that is emptied after application execution. It has an
autonumber ID primary key. How do I get the ID key to reset to 0 after each
use?

This can also add to significant bloating. Also how do you keep one
users records separate from another users?

See the TempTables.MDB page at my website which illustrates how to use
a temporary MDB in your app.
http://www.granite.ab.ca/access/temptables.htm Should be close
enough to VB.Net to be usable. Hmmm, maybe not.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
I would like to thank everyone that replied. The question was more curiosity
than requirement. Thanks again.

Gordon
 
Back
Top