ADO Objects
PRIMARY
Command
Connection
Recordset
SECONDARY
Error,Field,Parameter,Property,Record,Stream and DataTypes
ADO LockTypes
''When we open Records for Edit/Read/Updating
adLockOptimistic -- Lock record only when we actually issue an
update
adLockPessimistic -- Lock record when we start editing records
adLockReadOnly -- Records cannot be edited.. [DEFAULT]
adLockBatchOptimistic -- For server-side[adUseServer] cursors
or
adLockBatchOptimistic - Multiple users can modify the data and the
changes are cached until BatchUpdate is called
adLockOptimistic - Multiple users can modify the data which is
not locked until Update is called
adLockPessimistic - The provider locks each record before and
after you edit, and prevents other users from
modifying the data
adLockReadOnly - Read-only data
adLockUnspecified Lock type unknown
ADO CursorTypes
adOpenDynamic
adOpenStatic
adOpenKeyset
adOpenForwardOnly
What types of cursors are there?
There are 4 types of cursors supported by ADO. We'll look at them all
briefly now:
adOpenForwardOnly: This is the lightest (cheapest) cursor, and the
default when opening a recordset. It allows only forwards movement.
Only the most minimal information about the recordset is calculated by
Jet (eg you can't even get a .recordCount of the total number of
records in the recordset). If you try to move backwards using this
cursor, the recordset is closed, and the query re-executed. Avoid doing
this!
adOpenStatic: A static snap-shot of the records that match your search
criteria are put into the recordset. You can scroll forwards and
backwards, and set bookmarks. Changes made to the database by other
users however are not visible - all you can see are the records that
matched your search at the point in time when the query was executed
adOpenKeyset: A static snap-shot of the primary key values of the
records that match your search criteria are put into the recordset. As
you scroll backwards and forwards, the primary key value in the
recordset is used to fetch the current data for that record from the
database. This cursor thus allows you to see updates to the data made
by other users, but it doesn't let you see new records that have been
added by other users (because the primary key values for those records
are not in your recordset).
adOpenDynamic: A dynamic snapshot of the database is maintained by
OLEDB/ADO. All changes by other users to the underlying database are
visible. Obviously this is the most sophisticated cursor, and thus is
usually the most expensive. Because the data in the recordset is
dynamic, attributes like AbsolutePosition and AbsolutePage can not be
set. The adOpenDynamic cursor is not supported by the Jet OLEDB
Provider.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * *