Updating Record

Results 1 to 2 of 2

Thread: Updating Record

  1. #1
    Join Date
    Dec 1969

    Default Updating Record

    Hello,<BR><BR>I have a application that once it is submitted, it emails a link to a group of people that all are able to update the record and make modifications. <BR><BR>My problem is that I only want one person to to be able to make changes, if that record is open by one person it no longer can edited by any one else in that group.<BR><BR>what is the best way to do this?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Set a flag...

    ...in the record that indicates it is already in use.<BR><BR>You could use the time of day when the first user gets control of the record. If the time field is NULL, then the record is available for edit. If it is not null, then somebody else has the control.<BR><BR>You use the time of day as a sanity check: If somebody starts to edit and then walks away, then another user can have control if it has been more than NN minutes since the first user had control.<BR><BR>I think you could do the test and set in a single operation.<BR><BR>&#060;%<BR>SQL = "UPDATE table SET inUseTime=Now() " _<BR> & " WHERE ( isNull(inUseTime) OR inUseTime &#060; DateAdd(&#039;n&#039;,-90,Now()) )" _<BR> & " AND recID = " & editID<BR>count = 0<BR>yourConn.Execute SQL, count<BR>If count = 0 Then<BR> Response.Redirect xxx &#039; Somebody else has control<BR>End If<BR><BR>... go ahead and edit ...<BR>%&#062;<BR><BR>Query needs minor changes for SQL Server, of course.<BR><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