Results 1 to 2 of 2

Thread: Connections and Commands

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Connections and Commands

    Hi, I am trying to figure out if something will work (using a Connection and Command) object but I don't have much experience with them. Look at this pseudo-code, can you tell me if at the end of Sub A(), will all 3 queries be commited?

    Thanks
    Code:
    Dim MyConn As ADODB.Connection
    
    Sub A()
    		
    	MyConn.BeginTrans
    
    	' Execute Query 'A' MyConn
    
    	Call B(MyConn)
    
    	MyConn.CommitTrans
    
    End Sub
    
    
    Sub B(oConnection As Connection)
    
    Dim MyComm As New Command
    	
    	' Execute Query 'B' with oConnection
    	
    	Set MyComm.ActiveConnection = oConnenction
    	
    	Call C(MyComm)
    	
    	Set MyComm = Nothing
    
    End Sub
    
    
    Sub C(oCommand As Command)
    	
    	' Execute Query 'C' with oCommand
    End Sub
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  2. #2
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    Yes. All the three queries should get executed.

    Cheers!
    Abhijit
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

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