GK in the UK
Registered User.
- Local time
- Today, 21:29
- Joined
- Dec 20, 2017
- Messages
- 281
I've coded a big update routine which involves 6 tables all wrapped up in a DAO transaction workspace.
Typically in normal use, it could run for some minutes where a batch of transactions updates various control accounts, supplier and nominal account balances, history tables, that sort of thing.
There are two source tables, tblTransHeaders and tblTransLines. Currently it gets the right results by traversing tblTransHeaders and dealing with the linked TransLines in turn for each header. It works as long as all the transactions are posted to a single control account. First I create a recordset of all the TransHeaders, then as each one is processed, it creates a recordset of the TransLines linked to it and does all the updates.
But I've realised there is a flaw if the supplier or customer account has a creditors/debtors control override and I need to re-engineer it to deal with all the TransLines followed by all the associated TransHeaders, which will then be grouped by control account.
So my plan is, when the user clicks the button to proceed, to create two recordset from a sql select, a subset of the two transaction tables.
My question relates to the two recordsets which are 'in sync' at the moment of starting. But what happens to the records in the tables that are being updated? What happens if one of the records that is in the recordset is edited after the routine starts? Would Access allow it? What would happen if a transaction line record was deleted, or an additional transaction line was added (which would be linked to one of the TransHeader records in the Recordset)?
Just not sure what is going on with the Access Transaction workspace. My routine can seemingly churn away for quite a while then at the end I can cancel it and it's as if absolutely nothing happened. There are plenty of articles about what it does but I'd like to understand a bit about how it does it.
Typically in normal use, it could run for some minutes where a batch of transactions updates various control accounts, supplier and nominal account balances, history tables, that sort of thing.
There are two source tables, tblTransHeaders and tblTransLines. Currently it gets the right results by traversing tblTransHeaders and dealing with the linked TransLines in turn for each header. It works as long as all the transactions are posted to a single control account. First I create a recordset of all the TransHeaders, then as each one is processed, it creates a recordset of the TransLines linked to it and does all the updates.
But I've realised there is a flaw if the supplier or customer account has a creditors/debtors control override and I need to re-engineer it to deal with all the TransLines followed by all the associated TransHeaders, which will then be grouped by control account.
So my plan is, when the user clicks the button to proceed, to create two recordset from a sql select, a subset of the two transaction tables.
My question relates to the two recordsets which are 'in sync' at the moment of starting. But what happens to the records in the tables that are being updated? What happens if one of the records that is in the recordset is edited after the routine starts? Would Access allow it? What would happen if a transaction line record was deleted, or an additional transaction line was added (which would be linked to one of the TransHeader records in the Recordset)?
Just not sure what is going on with the Access Transaction workspace. My routine can seemingly churn away for quite a while then at the end I can cancel it and it's as if absolutely nothing happened. There are plenty of articles about what it does but I'd like to understand a bit about how it does it.