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!

Handling Multiple User Updates

Status
Not open for further replies.

gantibabu

Programmer
Oct 5, 2000
26
0
0
IN
Hi, i dont know if this is the right place to post this.
Could anyone help me with this.

The Scenario :

There would be say ten users. Each of the user is doing database communication i.e., adding a record to a particular table at the same time and for the record to be added a unique id has to be generated thru code (something like "USER00001"). Now for this, i generally take the maximum of the number ("?????" from "USER?????"). The problem is how to handle the situation since all the ten users want to update at the more or less same time. How would the record-locking be handled.

I have the least idea how to handle multiple user updations.

Waiting in anticipation...vijay.
 
You need to create a seperate table for the numeric portion of the ID. for each attempt to add to the recordset, open the table dbdenyread (i.e. exclusive). Get the value in the table (this is your uniques value), increment it by one and edit/update the value. amd release the table.

I have written a FAQ in Ms Access; Tables and Relationships? which includes the code to do this in Ms. Access. VB would be almost identical.
[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top