Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-11-2009
Member
 
Join Date: Nov 2009
Posts: 580
Lock Type in ADODB of Visual Basic 6.0

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.
Reply With Quote
  #2  
Old 28-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Lock Type in ADODB of Visual Basic 6.0

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
Reply With Quote
  #3  
Old 28-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Lock Type in ADODB of Visual Basic 6.0

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)
Reply With Quote
  #4  
Old 28-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Lock Type in ADODB of Visual Basic 6.0

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.
Reply With Quote
  #5  
Old 28-11-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Lock Type in ADODB of Visual Basic 6.0

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:
Code:
objRecordset.LockType
Example:

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
%>
LockTypeEnum Values:
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Lock Type in ADODB of Visual Basic 6.0"
Thread Thread Starter Forum Replies Last Post
Features of Visual Basic Gokul20 Software Development 5 13-03-2010 08:30 PM
what are Visual Basic IDE? Naresh Modi Software Development 2 06-03-2009 09:49 AM
Is GUI same like Visual Basic ? Caesar Software Development 2 02-03-2009 01:32 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM
Visual Basic on LAN djbbenn Software Development 2 05-08-2008 02:15 PM


All times are GMT +5.5. The time now is 12:19 AM.