Results 1 to 5 of 5

Thread: Abort a query

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    You must use BeginTrans, CommitTrans, Rollback. After the BeginTrans method starts a transaction that isolates all the changes made to the database, the CommitTrans method saves the changes. You can use the Rollback method to undo changes that you saved using the Update method.

    For sample:

    Dim cnn1 As ADODB.Connection

    ' Open connection...

    ' Start a transaction.
    cnn1.BeginTrans

    ' Change database...

    ' Ask if the user wants to commit to all the changes made above.
    If MsgBox("Save all changes?", vbYesNo) = vbYes Then
    cnn1.CommitTrans
    Else
    cnn1.RollbackTrans
    End If

    Best regards.

    ------------------
    smalig
    [email protected]
    smalig.tripod.com

  2. #2
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Post

    I use ADO to retrieve data from an Oracle database. Sometimes queries last for ever and everything in the application is frozen.

    Is there any way to execute a query in the background ? And maybe to create an 'Abort' button.

    Thanks for any input...

    Francis

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Transactions do not run in the background, that is a separate data protection feature altogether. Check out using asynchronous querys in MSDN -- it will send the query to the db and immediately execute the next statement -- you declare ADO connection using the WithEvents keyword to receive event notification

    [This message has been edited by Clunietp (edited 11-03-1999).]

    [This message has been edited by Clunietp (edited 11-03-1999).]

  4. #4
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Post

    Thanks for the help.

    I have one last question though. To query from my db, I use a tool called GQL. It has an 'Abort query' button and also seems to displays data as it is coming back.

    Any ideas on how this is done ?

  5. #5
    Addicted Member
    Join Date
    Jan 1999
    Posts
    165

    Post

    Use the events of your ADO to monitor number of records as they are delivered - FetchProgress & FetchComplete

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