SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to execute a transaction in asp using ADOs?

    how can i execute a oracle transaction in asp using ADOs?

    ref to below code, my aim is to avoid the deletion of the groupusers details if any errors occurs while deleting the group details. one way is to put it in the transaction. but how to do this?

    -----------------------------------------
    'delete from table1 (groupusers details)
    delStrSql = "delete from table1 where ABC ='"&strRefID&"'"
    objCmd.CommandText = delStrSql
    objCmd.execute
    objCmd.execute "commit"

    'delete table2 (group details)
    delStrSql = "delete from table2 where ABC ='"&strRefID&"'"
    objCmd.CommandText = delStrSql
    on error resume next
    objCmd.execute
    if err.number <> 0 Then
    If InStr(err.Description,"XXXX_TRG")>0 then
    response.redirect "index.asp?modc=" & strGBID & "&msg=This group can not be deleted as it is used else where in the application."
    End If
    end if

    --------------------------
    Happy Coding!!!
    Bruce Lee.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Location
    New York
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually there are methods that members of the ADO connection object you can use. BeginTrans, CommitTrans, RollbackTrans. Ehck out the link below - hope this helps.

    http://www.w3schools.com/ado/ado_ref_connection.asp

  3. #3
    SitePoint Zealot Bruce Lee's Avatar
    Join Date
    Jan 2005
    Location
    Singapore
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks. it works cool.
    Happy Coding!!!
    Bruce Lee.


Bookmarks

Posting Permissions

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