Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

ADODB connection events.

VB: ADODB.connection (transaction management)
How do I find out whether a transaction has started on a ADODB connection so that I can rollback the transaction in the error handler. If I try to rollback the transaction which wasnt started, it throws me an error.
Right now I am achieving this using boolean variable.
0
ashishshinde
Asked:
ashishshinde
1 Solution
 
coolsumuCommented:
0
 
rasenieroCommented:
just test the state of your adodb.

try this.


dim myado as adodb.recordset

set myado = new adodb.recordset
with myado

   if .state  = 1 then .close
   .open " "

   'you may go ahead
end with


Rhian
0
 
spongieCommented:
...or you can simply begin the transaction right away after you open the connection and commit it at the very end of the procedure just before closing the connection.  Also, in your error handler, make the rollback the last line just before the you close the connection.

This way, you'll know that there is always a transaction going on.  
0
 
CleanupPingCommented:
ashishshinde:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now