davidrobin
Programmer
I have an interesting sistuation with transaction.
My main code looks something like this
Private sub DoStuff()
on error goto Abort
conn.begintrans
...
do lots here including calling other
functions on other forms
MoreStuff()
...
conn.committrans
exit sub
Abort:
conn.rollbacktrans
msgbox err.number
end sub
If one of the functions on another form called from this routine has an error on it, I raise the error so it is displayed using the message box in the error handler like so.
Pulbic sub MoreStuff()
on error goto Abort
...
yet more stuff here.
...
exit sub
Abort:
err.raire err.number,err.source,err.description
exit sub
Now the problem is when the error is raised to DoStuff. DoStuff errors on the conn.rollbacktrans line with
'No Transaction is active.'.
I can't unserstand it as the begintrans line is definitely getting executed.
The transaction should still be active. Is there a quirk with transactions that anyone knows of.
I really need help on sorting this out as it is messing up my app.
David
Visual Basic 6 Ent
My main code looks something like this
Private sub DoStuff()
on error goto Abort
conn.begintrans
...
do lots here including calling other
functions on other forms
MoreStuff()
...
conn.committrans
exit sub
Abort:
conn.rollbacktrans
msgbox err.number
end sub
If one of the functions on another form called from this routine has an error on it, I raise the error so it is displayed using the message box in the error handler like so.
Pulbic sub MoreStuff()
on error goto Abort
...
yet more stuff here.
...
exit sub
Abort:
err.raire err.number,err.source,err.description
exit sub
Now the problem is when the error is raised to DoStuff. DoStuff errors on the conn.rollbacktrans line with
'No Transaction is active.'.
I can't unserstand it as the begintrans line is definitely getting executed.
The transaction should still be active. Is there a quirk with transactions that anyone knows of.
I really need help on sorting this out as it is messing up my app.
David
Visual Basic 6 Ent