Hi Bret,
I ran into this problem with a DO WHILE loop and had to take the Rollback out. It seemed to me that your BEGIN TRANS and ROLLBACK commands have to be at the same 'nesting' level. Have you tried a for/next loop? Does it give you the same problem?
And if not you may have to use an IF/Endif construction to check. Luckily you can only have 6 levels.
HTH
Barbara
>I put this code in my error handler and also in my cleanup code:
>
>DO WHILE TXNLEVEL() > 0
> ROLLBACK
>ENDDO
>
>
>It seems like a good idea to me. I had been getting errors following other errors that said "command cannot be used within a transaction" or something. Can anyone see a problem with what I have? There's a lot I don't know about proper error handling.