What type of cursor and record locking methods are most efficient?
All of the tests so far have used only "forward only" Grand to access the recordset. ADO provides more than three types of cursors for recordsets: Statically scrollable cursors, dynamically scrollable cursors, keyset cursors. Each cursor provides different capabilities, such as accessing the previous record and the last record, and seeing if other programs are modifying the data. However, it is beyond the scope of this article to specifically discuss the usefulness of each type of cursor, which is a comparative analysis of various cursor types.
All other cursor types require additional overhead compared to "forward only" types of cursors, and these cursors are generally slower in the loop. Therefore, we would like to share with you the following caveat: Never think so--"well, sometimes I use a dynamic cursor, so I always use this cursor." ”
The same view also applies to the selection of record locking methods. The previous test used only the read-only locking method, but there are three other ways: Conservative, open, open batch mode. As with cursor types, these locking methods provide different capabilities and control over the processing of recordset data.
We come to the following rules:
Use the simplest cursor types and record locking methods that are appropriate for processing tasks.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.