Configuration of LockType as a Property of the Recordset Object
Sub OptimisticRecordset()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Open "Select * from Employees"
rst("City") = "Village"
rst.Update
Debug.Print rst("City")
rst.Close
Set rst = Nothing
End Sub
Related examples in the same category