Difficulty: Medium
Correct Answer: There are four main Recordset cursor types: Forward only, Static, Keyset, and Dynamic
Explanation:
Introduction / Context:
When working with databases in classic Visual Basic, developers often used ActiveX Data Objects to execute queries and retrieve results into Recordset objects. Recordsets support different cursor types that control how you can move through records and whether you can see changes made by others. Knowing the available cursor types and their count is a common interview topic for legacy Visual Basic or ADO based systems. This question asks you to recall how many main cursor types exist and to name them correctly.
Given Data / Assumptions:
Concept / Approach:
ActiveX Data Objects defines four main cursor types for Recordsets: Forward only, Static, Keyset, and Dynamic. A forward only cursor allows only forward movement through the records and is often the fastest. A static cursor provides a snapshot of data and does not reflect changes made by others after the query. A keyset cursor can detect changes to existing rows but does not see new rows added by others. A dynamic cursor can reflect most changes, including inserts, updates, and deletes by other users, depending on provider support. Remembering both the number and the names is important for answering this question correctly.
Step-by-Step Solution:
Step 1: Recall the ADO CursorTypeEnum values: adOpenForwardOnly, adOpenStatic, adOpenKeyset, and adOpenDynamic.
Step 2: Count these values to see that there are four main cursor types.
Step 3: Match these names and number against the options given.
Step 4: Option a lists Forward only, Static, Keyset, and Dynamic and states that there are four cursor types, which agrees with the remembered set.
Step 5: Reject the other options that list incorrect counts or fictional cursor names such as Hash, Tree, Graph, Queue, and Stack.
Verification / Alternative check:
If you review legacy ADO documentation or inspect the CursorTypeEnum in an integrated development environment, you will see these four constants documented as the primary cursor types. Real code examples set Recordset.CursorType to one of these values depending on performance and concurrency requirements. This evidence confirms that there are four main cursor types with the names given in option a.
Why Other Options Are Wrong:
Option b simplifies the concept incorrectly into Read only and Write only, which are not ADO cursor types but might describe lock types in other contexts. Option c claims there is only one cursor type, which contradicts the ADO design and would not let developers control behaviour. Option d invents data structure names like Hash and Tree as cursor types, which do not appear in ADO documentation.
Common Pitfalls:
A frequent confusion is mixing cursor types with lock types, such as optimistic and pessimistic locking, which are separate settings. Another pitfall is not understanding the performance and concurrency trade offs between forward only and dynamic cursors. For exam questions, focus on remembering that ADO offers four main cursor types: Forward only, Static, Keyset, and Dynamic.
Final Answer:
In ADO Recordsets, there are four main cursor types: Forward only, Static, Keyset, and Dynamic.
Discussion & Comments