commit -rollback Ado-connection object

Results 1 to 2 of 2

Thread: commit -rollback Ado-connection object

  1. #1
    Join Date
    Dec 1969

    Default commit -rollback Ado-connection object

    I am beginner in asp/ado<BR>I am using ADO connection object to insert data into 4 different tables in same Access(mdb) database.While inserting if any error occur i want to rollbak all the data which are inserted. I tried the following code but it is not removing data from all tables.<BR><BR>con.BeginTrans() <BR><BR><BR>con.Execute(ins1)&#039;inserting personal data to per_table<BR><BR>if con.Errors.Count &#062;0 then<BR>con.RollbackTrans() <BR>end if<BR>con.Execute ins2 &#039;inserting education data to edu_table<BR>if con.Errors.Count &#062;0 then<BR>con.RollbackTrans() <BR>end if<BR>con.Execute ins3 &#039;inserting Emploeyment data to emp_table<BR>if con.Errors.Count &#062;0 then<BR>con.RollbackTrans() <BR>end if<BR>con.CommitTrans()<BR><BR>pl.let me now what is wrong?How to Do?<BR>TIA<BR>ramesh

  2. #2
    Join Date
    Dec 1969

    Default RE: commit -rollback Ado-connection object

    Try <BR>if con.error.count=0

Posting Permissions

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