N
N. Cotton
I currently use pessimistic record locking and test if the record is
currently locked using the following code.
If the record is not locked the function returns instantaneously. However,
if the record is locked the time taken to trigger error 3218 is around 5
seconds. Is there a way to reduce the speed it takes to test if the record is
locked?
Public Function IsRecordLocked(rs As Recordset) As Boolean
'Returns True if the record is locked for editing by another user
'rs = testing reecordset
IsRecordLocked = False
With rs
On Error GoTo Err_Lock
.Edit
.Update
On Error GoTo 0
End With
Exit Function
Err_Lock:
IsRecordLocked = True
Resume Next
End Function
currently locked using the following code.
If the record is not locked the function returns instantaneously. However,
if the record is locked the time taken to trigger error 3218 is around 5
seconds. Is there a way to reduce the speed it takes to test if the record is
locked?
Public Function IsRecordLocked(rs As Recordset) As Boolean
'Returns True if the record is locked for editing by another user
'rs = testing reecordset
IsRecordLocked = False
With rs
On Error GoTo Err_Lock
.Edit
.Update
On Error GoTo 0
End With
Exit Function
Err_Lock:
IsRecordLocked = True
Resume Next
End Function