At least not the way i would think it should
Selecting yes in the msgbox dosent rollback. Why?
Code:
Dim rst As New ADODB.Recordset
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
With rst
ws.BeginTrans
.Open "SELECT * from [test]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
.AddNew
!test = "test2"
.Update
.Close
If MsgBox("vil du avbryte?", vbYesNo, "logidose") = vbYes Then
MsgBox "rollback"
ws.Rollback
Exit Sub
End If
ws.CommitTrans
End With
Comment