ADO/SQL - Locking - Transactions

Results 1 to 2 of 2

Thread: ADO/SQL - Locking - Transactions

  1. #1
    Join Date
    Dec 1969

    Default ADO/SQL - Locking - Transactions

    So, I&#039;m trying to grasp the concepts of locking and transactions.<BR>I have read documents all over the web and can&#039;t find an example or the answer to what I want to do.<BR>I want to edit fields of a database (one row at a time) in a web form. When a page is being viewed in edit mode, I don&#039;t want anyone else to be able to edit it. <BR>So, I guess I want to lock the field when the edit form comes up. <BR>How, and where do I specify that I want row-locking???<BR>Then, how do I check if the file is locked when another user requests to edit that row?<BR>Thanks so much for any suggestions or direction. A simple example would be the most helpful, otherwise hopefully a description will get me started.<BR>-Mac

  2. #2
    Join Date
    Dec 1969

    Default my thoughts

    I would just do this on the application level not the database. <BR>Do something like insert the userid and datetime of the "lock" into a field on the table. <BR><BR>As far as transactions are concerned, I use them on updates and inserts to make sure everything is executed. It&#039;s an ALL or nothing type of thing.<BR>here&#039;s a simple example:<BR><BR>set cn = Server.CreateObject("ADODB.Connection")<BR> YOURCONNECTIONSTRING<BR>cn.begintrans<BR><BR>cn.ex ecute(ANYSQL)<BR>cn.execute(ANYSQL)<BR>cn.execute( ANYSQL)<BR><BR>cn.committrans<BR>cn.close()

Posting Permissions

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