Without a primary key on the quote table, you can't really guarantee that
the quote numbers remain unique. Why not make the quote number the PK, so
you at least get that much protection against corrupt data?
Access can't guarantee transactional integrity between the time you read the
current value and the time you enter a new row with your newly-computed
value. So I think you would need to include some kind of locking feature in
your web application to ensure that only one user at a time can be acquiring
a new quote number. If you really care that the quote numbers remain
sequential, it would seem that the time to assign the new quote numbers is
as late as possible, when you are entering the new row into the db.
Otherwise, if you assign a user a new quote number but they don't complete
the process and actually create that quote in the db, you'll have a gap in
your sequence numbers.
You might be able to have your sql insert statement compute and assign the
next quote number while it is adding the row to the db, but Jet sql is more
limited than SQL Server in that regard.
Firstly, Jet databases (which some people call Access
databases:
http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine) are
a really bad
choice for websites, especially heavily used ones, for many reasons - is
there a reason that you're not using something more suitable?
Of course there is! The likelihood increases with the number of concurrent
users...
Impossible to tell without knowing your database schema...
http://support.microsoft.com/kb/232144
But avoid Jet for web applications if you possibly can...
I can't avoid it. The records must be written there. I would love to
use the Identity field but whoever created this "awesome" table back
in the stone age didn't create any primary keys or autoincrementing
numbers. Is there another way?
Before i can write the new record I need to figure out what the next
quote number is so I can write the new record. Quote numbers start
with today's date like MMDDYY and a an incremening number like 01, for
example quotes done today are 08270901, 08270902, 08270903, and so
on. So when the user clicks submit I query the quote numbers in the
table and determine they go up to # 3 so my new record will be quote
number 08270904.