Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. transaction

transaction

Scheduled Pinned Locked Moved Visual Basic
helptutorialdatabaseannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amilapradeep
    wrote on last edited by
    #1

    i have to insert one record and update another 2 table. if update is no successful i want rollback inserted transaction. problem is i use one public connection to create connection with db and every time i use that.and use class and it have update and insert function. in this case i don't know how to use transaction object. i use vb 2005. as a example in case i want to add a record i just call classname.addrecord("qry") and classname.update("qry") can anyone help me. regards amila pradeep

    G 1 Reply Last reply
    0
    • A amilapradeep

      i have to insert one record and update another 2 table. if update is no successful i want rollback inserted transaction. problem is i use one public connection to create connection with db and every time i use that.and use class and it have update and insert function. in this case i don't know how to use transaction object. i use vb 2005. as a example in case i want to add a record i just call classname.addrecord("qry") and classname.update("qry") can anyone help me. regards amila pradeep

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Create overloads for the AddRecord and Update methods that takes a transaction object along with the SQL query. Use the transaction object in the actual database calls in the methods.

      --- b { font-weight: normal; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups