Results 1 to 2 of 2

Thread: How to get transaction state

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Posts
    26

    How to get transaction state

    How to get transaction state?
    ------------------
    sample code
    ------------------
    dim myado as ADODB.Connection
    dim myrec as ADODB.Recordset
    set myado = new ADODB.Connection
    set myrec = new ADODB.Recordset
    .
    .
    .
    .
    myado.begintrans
    '-- Insert code
    '-- Here



    '-- I want to know the state of transaction ( transaction started or transaction end ).

    Help Me....!!!!!

  2. #2
    khalik
    Guest
    if u are working with SQl i have a example BOL
    Code:
    BEGIN TRANSACTION
    UPDATE authors SET au_lname = upper(au_lname)
    WHERE au_lname = 'White'
    IF @@ROWCOUNT = 2
       COMMIT TRAN
    
    IF @@TRANCOUNT > 0
    BEGIN
       PRINT 'A transaction needs to be rolled back'
       ROLLBACK TRAN
    END
    or in vb code before u commit or rollback execute this

    select @@TRANCOUNT

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