auto incrementing numbers?

  • Thread starter Thread starter BFprout
  • Start date Start date
B

BFprout

Guest
Hello,

I am new to the world of databases, and I would like to know the easiest way to have a column with auto incrementing numbers.

I want that everytime a user enter data in a form, the new record goes into the database with a unique number.

thanks in advance
 
Be warned!!!! Autoincrement fields (one and only one per table, please) will surely increment automatically to produce an ever-increasing number. But the number is not necessarily continuous. Gaps occur any time someone STARTS to add a new record but then changes their mind. That is because the number is allocated when the otherwise empty record is created to receive the data you are about to enter. If you are sharing the DB and another person tries to add a record (and you are doing optimistic locking), and you add a record, and then the other person retracts the record, nothing else gets stored but you now have a gap in the numbering scheme.
 
ok I get it. For my purposes I don't really mind if there are empty records.

However I am wondering why when I checked on the internet for solutions, people always exchange complicated codes. Why should anyone use a SQL code to do the auto increment if it's already in Access?

thanks
 

Users who are viewing this thread

Back
Top Bottom