Click to See Complete Forum and Search --> : Help!! VB / Access 97 Multiple Transactions Don't Work!!!!


myscobra
October 27th, 1999, 02:21 PM
I am having a problem processing multiple transactions. I am using VB6 with an Access 97 database. I am using a Workspace object to
commit or rollback transactions to the database.

I have two forms that have 2 separate transactions.I am committing a transaction and then unloading the first form. The user is forced into the second form that has another transaction. When the code in the 2nd form tries to pull data from my database, it can't find the data and gives a "type mismatch" error. I've tried closing the database and setting it to nothing after the first transaction and I've tried closing the workspace and creating a new one. Nothing works.

I know the code in the 2nd form works correctly because if the application is started and the 2nd form is chosen before going into the first form, the transaction works correctly. The second form's transaction doesn't work correctly when going from the first form into the second. Any ideas?

I also tried:

1. Tried giving a rollback when the 2nd form opens. Got error "trying to rollback without begintrans", so...
2. Tried giving a begintrans and committrans when the 2nd form opens. Did not work. It still could not see the database after the 1st form's committrans.
3. Tried using another database variable and another variable for the recordset. It still could not see the database.

I guess my only other solution is to cause the application to stop execution after I commitTrans and then make the user re-open the application.

Other ideas?