Results 1 to 5 of 5

Thread: Lock Type in ADODB of Visual Basic 6.0

  1. #1
    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.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    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

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    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)

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    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.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    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.

Similar Threads

  1. Features of Visual Basic
    By Gokul20 in forum Software Development
    Replies: 5
    Last Post: 13-03-2010, 08:30 PM
  2. what are Visual Basic IDE?
    By Naresh Modi in forum Software Development
    Replies: 2
    Last Post: 06-03-2009, 09:49 AM
  3. Is GUI same like Visual Basic ?
    By Caesar in forum Software Development
    Replies: 2
    Last Post: 02-03-2009, 01:32 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Visual Basic on LAN
    By djbbenn in forum Software Development
    Replies: 2
    Last Post: 05-08-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,974,824.44474 seconds with 17 queries