Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2003

    Unanswered: Does my code correct or not ?

    Hello expert,

    I write Sub that receive Connection object as reference-type argument. This Sub is called within transaction block. Problem is I'm not sure what I write is correct or not. Because I understand that CNN in UpdateRecord procedure is another instance of paCNN. BUT if this is true and because of transaction depends on connection object (myCNN/paCNN); Does it mean No matter myCNN is committed or rollbacked, CNN still update record ?

    Thank you in advance.

    Following is my code :

    ' Calling procedure
    Call UpdateRecord(myCNN)
    If ErrIsFound then
    myCNN.Close : Set myCNN = Nothing

    Public Sub UpdateRecord (paCNN as Connection)
    Dim CNN As New Connection
    Dim SQLStrAs String

    Set CNN = paCNN
    SQLStr= "UPDATE ...."
    CNN.Execute SQLStr
    CNN.Close : Set CNN = Nothing
    End Sub
    Last edited by suntisuk; 11-18-03 at 14:05.

Posting Permissions

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