How To Speed Up Data Access by Using BeginTrans & CommitTrans (146908)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
This article was previously published under Q146908 SUMMARY
You can speed up database operations in a Microsoft Access
database by using transactions. A transaction starts with a BeginTrans
statement and ends with a CommitTrans or Rollback statement. However, for
reasons relating to stack usage it is recommended that these code regions
are kept as small as possible. This ensures optimal performance and
reliability." For more information as to when to use transactions, please
see the following article in the Microsoft Knowledge Base:
145757
: Ideas to Consider When Using Transactions
The sample program below is over 17 times faster when using
BeginTrans/CommitTrans. Performance may vary on different computers.
REFERENCES- Microsoft Visual Basic, version 4.0, "Professional Features Book 1,"
Page 204
- "Microsoft Developer Network News" newspaper, January 1994, Volume 3,
Number 1, published by Microsoft Corporation.
Modification Type: | Minor | Last Reviewed: | 7/15/2004 |
---|
Keywords: | kbhowto KB146908 |
---|
|