The ADO Recordset object is used to hold a set of records from a database table. A Recordset object consist of records and columns (fields).
In ADO, this object is the most important and the one used most often to manipulate data from a database.
ProgID
set objRecordset=Server.CreateObject("ADODB.recordset")
When you first open a Recordset, the current record pointer will point to the first record and the BOF and EOF properties are False. If there are no records, the BOF and EOF property are True.
Recordset objects can support two types of updating:
- Immediate updating - all changes are written immediately to the database once you call the Update method.
- Batch updating - the provider will cache multiple changes and then send them to the database with the UpdateBatch method.
In ADO there are 4 different cursor types defined:
- Dynamic cursor - Allows you to see additions, changes, and deletions by other users.
- Keyset cursor - Like a dynamic cursor, except that you cannot see additions by other users, and it prevents access to records that other users have deleted. Data changes by other users will still be visible.
- Static cursor - Provides a static copy of a recordset for you to use to find data or generate reports. Additions, changes, or deletions by other users will not be visible. This is the only type of cursor allowed when you open a client-side Recordset object.
- Forward-only cursor - Allows you to only scroll forward through the Recordset. Additions, changes, or deletions by other users will not be visible.
The cursor type can be set by the CursorType property or by the CursorType parameter in the Open method.
Note: Not all providers support all methods or properties of the Recordset object.
Practice Excercise Practice now