Incrementing Number

D

Daniel

Background Info:
Using .asp page to create database records. I want to set
up a field in the database that increments by 1 each time
a new record is created. The only time the database will
ever be opened using Access is for any type of
maintenance, all data entered will be through .asp. How
can I accomplish this?
 
D

Douglas J. Steele

Create the field, and set its type to AutoNumber. When you're writing to the
table, don't provide a value for this field.
 
D

Douglas J. Steele

There's "meaning something" and there's "meaning something".

If you can live with the fact that there will be gaps in the numbering,
there's nothing intrinsically wrong with using the AutoNumber as a reference
number.

Realistically, the only alternative is to look up the highest number already
used and increment it prior to each record insert. That's twice as much
database traffic, and if your site gets a lot of hits, that's something you
want to avoid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top