dbTalk Databases Forums  

ODBC Transactions will not rollback

comp.database.ms-access comp.database.ms-access


Discuss ODBC Transactions will not rollback in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
April
 
Posts: n/a

Default ODBC Transactions will not rollback - 09-04-2003 , 04:17 PM






I have an Access 97 db linked through ODBC to an Oracle 7.3 db. The
users seelect data found in a list box and perform various functions
on the data.

Here I am simply trying to update some data based on the data selected
in the list box. If the any of the updates fail I want to roll back
the whole thing. However, the updates that occurred before the
failing point are NOT rolled back.

What is wrong with the way I am using access transactions?

Thank you,
April

Set rs = db.OpenRecordset("qryLevel1Relations")
If Not (rs.EOF And rs.BOF) Then
wrk.BeginTrans
rs.MoveFirst
Do While Not rs.EOF
If ModifyTriggers(rs!ChildTable, "disable") Then
'strSql = vbNullString
strSql = strSql & "Update " & rs!ChildTable &
" Set i_s = #" & newdate & "# where i_s = #" & olddate & "# "
strSql = strSql & "and op_desig = '" &
opdesig & "' and sect_num = " & sectnum
On Error Resume Next
db.Execute strSql, dbFailOnError
If Err <> 0 Then
wrk.Rollback
SetStatusMessage sUpdateFail,
Forms!frmMain
GoTo Cleanup
Else
strSql = vbNullString
strSql = strSql & "Update " &
rs!ChildTable & " Set o_s = #" & newdate & "# where o_s = #" & olddate
& "#"
strSql = strSql & "and op_desig = '" &
opdesig & "' and sect_num = " & sectnum
On Error Resume Next
db.Execute strSql, dbFailOnError
If Err <> 0 Then
wrk.Rollback
SetStatusMessage sUpdateFail,
Forms!frmMain
GoTo Cleanup
End If
End If
Else
SetStatusMessage sTriggerDisable,
Forms!frmMain
GoTo Cleanup
End If
rs.MoveNext
Loop
wrk.CommitTrans
DateChange = True
End If

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.