Pat: Granted that record order has no meaning, but record NUMBERING is a very
common business requirement. Invoices, checks, orders, shipments, jobs,
projects, help requests, etc, etc, all typically need to be numbered, and
often audit trail requirements are that the numbering be consecutive (no
gaps). That is how I understand keesb's issue.
Keesb: You are right that autonumber is not applicable, because it does not
guarantee consecutive numbering. A simple way to generate consecutive numbers
is to query the project table for MAX(ProjectNo), add 1 to it and use that
for the new project. The project no. field must be uniquely indexed. This
will work in a multi-user environment, altough with serious performance
issues if there is heavy concurrent creation of new projects. Example: Say
the max project number is 123, and several users read it. Each user
increments it to 124 and attempts to write a new project record. Only one
user will succeed, the others will fail due to duplicate value in a unique
index. They can then retry by re-reading the max (now 124) and incrementing
it by 1, etc. You can see that if there are many concurrent users, it may
take many tries for a particular user to get his record inserted. For heavy
concurrent use, you should consider a SQL Server back end which can implement
very robust transactional processing.