Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Lock A Record, and other associated tasks

Status
Not open for further replies.

EdAROC

Programmer
Aug 27, 2002
93
US
Requirements: Retrieving a Next Number. Similar to a PO# scenario, except this one's for a few customers requesting a unique ID on each pallet. This is NOT an autonumber situation.

There is a table CustLabelData with fields CustomerID and NextNum. One record for each customer requiring this service.

Currently this is a single user environment, going to multi-user. Need to avoid assigning duplicate #s.

Logic:
1. Read and lock a record, if locked then wait (display message to end user)
2. Update value (i.e. NextNum = NextNum + NumPalletLabels)
3. Unlock record

Help! I don't know how to perform steps 1 and 3.
 
Have a look at:
Why AutoNumber shouldn't be used in MultiUser databases (And How to ge the Unique Number)
faq700-184

Note especially dbDenyRead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top