locking the db when inserting new entry

Results 1 to 2 of 2

Thread: locking the db when inserting new entry

  1. #1
    Join Date
    Dec 1969

    Default locking the db when inserting new entry

    I have users entering information through a form (using ASP)...which gets entered into my DB once they click submit. How do I make sure that if two or more users click submit at once, it doesn&#039;t get messed up? Is there some way to lock it?<BR><BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default If only one record per user...

    ...not problem. It happens automatically.<BR><BR>If you are inserting into multiple tables and want to be sure, for example, that the right foreign key is associated with the right primary key, then look at the ASPFAQs and/or research the "@@IDENTITY" property for SQL Server (and the JET 4 engine).<BR><BR>If you mean something more than this, then explain *how* you are afraid multiple users can mess each other up. (And there are ways! But you may not need to worry about them.) You might end up looking into Transactions. Worst case, yes, you can lock databases and tables...and even an entire Application...but let&#039;s avoid all that if we can, okay?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts