Can't seem to get the code given in Tips and Tricks working in v6.0 Build 766
I have added a asp code snippet on the edit page and named it EditOnLoad:
[codebox]set rstmp = Server.CreateObject("ADODB.Recordset")
rstmp.Open "select IsLocked, LockTime from " & strTableName & " where " & strWhereClause, dbConnection
if rs("IsLocked")=1 and DateDiff( "n", rs("LockTime"), now() )<5 then
Response.write "Record is locked. Come back later"
rstmp.close : set rstmp = nothing
Response.end
else
rstmp.close : set rstmp = nothing
dbConnection.Execute "update " & strTableName & " set IsLocked=1, LockTime=now() where " & strWhereClause
end if[/codebox]
I have also added in the before record updated event.
[codebox]dbConnection.Execute "update " & strTableName & " set IsLocked=0, LockTime=now() where " & where[/codebox]
I have checked the tables in the DB and they are being updated with the date time and islocked function. However I can still edit a record even when its open by someone else.
Thanks