Hi, I am a beginner in Visual Basic 6.0. I want the details of Lock Type in Visual Basic 6.0. Can anyone provide me that. The which I am using does not contains that information. Please, give me that. I am waiting for your positive reply.
Hi, I am a beginner in Visual Basic 6.0. I want the details of Lock Type in Visual Basic 6.0. Can anyone provide me that. The which I am using does not contains that information. Please, give me that. I am waiting for your positive reply.
Hi, I am also a beginner in visual basic 6.0. When I read this question on forum I search for it in my book of Compete reference. I have got locksypes in that as follows:
Four types of locks availbale in ADODB:
1.Optimistic
2.pessimistic
3.batch optimistic
4.readonly
Hi, in my classes I have got the Lock Type in ADODB of Visual Basic 6.0. They are totally in number of 5. As follows:
1)adLockBatchOptimistic
2)adLockOptimistic
3)adLockPessimistic
4)adLockReadOnly
5)adLockUnspecified (hidden)
Hi, I have some information about the Lock Type in ADODB of visual basic 6.0. LockType Property Return Values. It Sets or returns one of the following LockTypeEnum values:
- adLockReadOnly : Default. Read-only; the data cannot be modified.
- adLockPessimistic : Pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing.
- adLockOptimistic : Optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the Update method.
- adLockBatchOptimistic : Optimistic batch updates. Required for batch update mode as opposed to immediate update mode.
HI, The LockType property sets or returns a LockTypeEnum value that specifies the locking type while editing a record in a Recordset. Bydefault it is adLockReadOnly.
Syntax:
Example:Code:objRecordset.LockType
LockTypeEnum Values:Code:<% set connect=Server.CreateObject("ADODB.Connection") connect.Provider="Microsoft.Jet.OLEDB.4.0" connect.Open(Server.Mappath("northwind.mdb")) set rst=Server.CreateObject("ADODB.recordset") sql="SELECT * FROM emplyoee" rst.CursorLocation=adUseClient rst.CursorType=adOpenStatic rst.LockType=adLockBatchOptimistic rst.Open sql, connect rst.Close conn.Close %>
Constant : Value : Description
- adLockUnspecified :-1 : Unspecified type of lock. Clones inherits lock type from the original Recordset.
- adLockReadOnly : 1 : Read-only records
- adLockPessimistic : 2 : Pessimistic locking, record by record. The provider lock records immediately after editing
- adLockOptimistic : 3 : Optimistic locking, record by record. The provider lock records only when calling update
- adLockBatchOptimistic : 4 : Optimistic batch updates. Required for batch update mode
Last edited by Reegan; 28-11-2009 at 01:07 PM.
Bookmarks