PROPERTY:  Recordset::LockType

LockTypeEnum = recordsetobject.LockType
recordsetobject.LockType = LockTypeEnum


The LockType property sets or returns one of the LockTypeEnum constants that indicates the type of lock in effect on a record for editing. The default is read-only.

You can only set this value when the Recordset is closed. Some providers do not support all of the lock types. If a provider does not support the requested value, it will substitute another value. After the Recordset is opened, you can return this property to determine the specific value being used.

LockTypeEnum Constants
 
Constant Value Description
adLockBatchOptimistic 4 Multiple users can modify the data and the changes are cached until BatchUpdate is called
adLockOptimistic 3 Multiple users can modify the data which is not locked until Update is called
adLockPessimistic 2 The provider locks each record before and after you edit, and prevents other users from modifying the data
adLockReadOnly 1 Read-only data
adLockUnspecified -1 Lock type unknown

 
Code (VBScript):
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Set objRecordset.ActiveConnection = strConnection
...
objRecordset.LockType = adLockOptimistic
...
objRecordset.Open "ChantList", , , , adCmdTable

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information