INCREASING SPEED WITH TRANSACTIONS

In the CopyData subroutine in Listing 5.10, notice the wspTransact.BeginTrans line. Access supports transactions, which, in some cases, greatly increase the speed of modifying and updating data. By using a transaction, you can group a large number of updates into a single operation.

However, transactions are more than just faster updates. By using transactions, you can modify one or many tables. At any point during the update, you can decide to cancel, or roll back, the transaction. Rolling back a transaction causes no updates to be saved to your database.

Note

If you plan to use transactions for performance purposes, be sure to run benchmarks with and without the transaction commands. In prior versions of Jet ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.