Test open DAO transactions

G

Guest

Hi,

In my code I would like to test wether a transaction is open. Is there a way
to get the number of open transactions from CurrentDb or should I manually
keep count and Reroll accordingly if an error occurs? Naturally I want to
avoid rolling back when there are no transactions open, since that generates
an additional error.
 
A

Allen Browne

AFAIK, Access does not expose to you the number of uncommitted DAO
transactions, nor the way in which they are nested (to 5 levels, from
memory.) You need to do that yourself.

There is a discussion of the typical traps when using transactions in this
article:
Archive: Move Records to Another Table
at:
http://allenbrowne.com/ser-37.html
along with the usual approach of setting a flag in the procedure that
creates the transaction so you know its status.
 
G

Guest

Thanks. Just the answer I was looking for. Too bad it is not the 'perfect'
solution (hard to manage transactions spanning multiple modules without
setting up some sort of globally accessible framework). But I think I can
make it work in my app.

"Allen Browne" schreef:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top