Results 1 to 2 of 2

Thread: A basic question about ADO objects

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142

    Post

    I know that three main objects with ADO object modal are connection, command and recordset, and once their jobs are done, these objects should be set to nothing to release memory. My question is to go to connection.

    1) what is difference between set connection object to nothing(ie, set connection = nothing ) and close a connection (ie, connection.close).

    2) if a connection(through network) isnot yet closed, but all ADO objects are set to nothing, what is a picture to network load?. if a program is closed without closing the connection, what is going to happen to the connection. For a program with one database, only One connection is needed no matter how many queries you want to apply. is that true?

    3)I heared about "Optimistic locking" and "Pessimistic locking", how to apply them in ADO

    Someone please give me a free lesson , Thanks

    [This message has been edited by Winla (edited 02-18-2000).]

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    1. Close method is just closing the connection between the Client and a Server.
    Closing an object does not remove it from memory; you can change its property settings and open it again later. To completely eliminate an object from memory, set the object variable to Nothing after closing the object


    2. Generally speaking, yes, you need only one connection, but not necessarily, You have to have only one. For example, you can have 2 connections of 2 different Servers or databases.

    3. Here is what MSDN has to say about locking:

    adLockUnspecified - (1) Does not specify a type of lock. For clones, the clone is created with the same lock type as the original.
    adLockReadOnly 1 Indicates read-only—you cannot alter the data.

    adLockPessimistic - (2) Indicates 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 - (3) Indicates optimistic locking, record by record—the provider uses optimistic locking, locking records only when you call the Update method.
    adLockBatchOptimistic 4 Indicates optimistic batch updates—required for batch update mode as opposed to immediate update mode.



    ------------------

    Serge

    Senior Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819


    [This message has been edited by Serge (edited 02-18-2000).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width