How do I implement transactions in Access? -


I am stuck in implementing transaction / rollback facility on an access form.

Here's what I did outline:

In the load handle of the form, I start the transaction

  dbEngine.BeginTrans gInTransaction = After that, there is a "Cancel" button, whose click is like a handler  
  dbEngine.Rollback gInTransaction = false doCmd.close acForm, " Finally, in the unload handler of the form:  
  if gInTransaction then dbEngine.CommitTrans gInTransaction = false 'if at the end of the bus'  

Now, there seem to be no charge on the rollback form And not "Cancel" button does not even roll back some of the pressing

I also tried to change with Dibiijin the Dibiijin. Workspace (0), with no effect.

So, the question is: how do I apply transactions in the entrance?

Thanks for any indication in the right direction, René

I do not think That you can apply transactions on a form, where updates are made on a record set (previously updated and later with updated events), while the transaction is linked to the execution of INSERT, UPDATE or DELETE commands on the database.

EDIT: If your idea is to be able to manage all the changes made in one continuous form at a time, you have 2 different solutions:

  1. First One has to attach a disconnected ADODB record set to your form, and call the 'batch update' method after all your changes have been made though I have not checked the doctor, I think you are able to catch that exception Will be Maybe through the connection object at this stage.
  2. Secondly, the client's work on copying the original data that we apply to our applications, on the customer side, we keep track of all the inserts, deleted and updated updates. Once the user approves of their changes, the client creates a set of SQL instructions according to the changes made on 'Flight', and sends them into the database. These transactions are very easy to send these instructions (either for one transaction per line or for all changes). We took some time to fix this solution, but it was worth the job. Form validation is now available for our app There is a unique function used on each form. There is also the recognition of 'one form for multiple tables' in the ceremony.

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -