charon
05-23-2003, 06:44 AM
I'm now really confuse with the Database Transaction and The Server Site transaction (MTS), DON"T know which
I suppose to use. i.e
What I'm going to to do if there has an error occur on any of the SQL statement, please rollback all the SQL statement which have been executed, else
it will be causing unproper record. i.e:
Con.BeginTrans
con.Execute(Update SQL)
strSQL = "Select * From InvalidTable Where Cat = C"
Set Rs = Con.Execute(strSQL)
If Not Rs.EOF Then
Con.Execute "Update SQL2"
Else
Con.Execute "Update SQL3"
End If
If Err.Number <> 0 Then
Con.RollbackTrans
objectContext.SetAbort
Else
Con.CommitTrans
objectContext.SetCommit
End If
I suppose to use. i.e
What I'm going to to do if there has an error occur on any of the SQL statement, please rollback all the SQL statement which have been executed, else
it will be causing unproper record. i.e:
Con.BeginTrans
con.Execute(Update SQL)
strSQL = "Select * From InvalidTable Where Cat = C"
Set Rs = Con.Execute(strSQL)
If Not Rs.EOF Then
Con.Execute "Update SQL2"
Else
Con.Execute "Update SQL3"
End If
If Err.Number <> 0 Then
Con.RollbackTrans
objectContext.SetAbort
Else
Con.CommitTrans
objectContext.SetCommit
End If