Open Method - Microsoft Activex Data Object - ADO
The Open Method with all options explained
The Open Method is a common feature to all methods of connecting to a database.
Once a connection is made you want to do something with the data such as
retrieve (select) update, or execute a command or stored procedure - you do all
these with the open statement. The open statement has the following
(Note: the following information is paraphrased from the Microsoft Access 2003
str_source, str_connection, int_cursortype, int_locktype, lng_options
We also have 100's of programming examples from simple to complex. You can jump to our Access tutorials here.
str_connection - optional argument which is a connection string
int_cursortype - optional argument which specifies the cursor type to be
used by the open statement - the following are valid entries with there
numeric constant in parenthesis:
adOpenForwardOnly (0) - this is the default cursor type if none is
specified. This is similar to a static cursor, except that you can
only scroll forward through records. This improves performance when you need
to make only one pass through a Recordset.
adOpenKeyset (1) - The keyset cursor is like a dynamic cursor except
that you can't see records that other users add, although records that other
users delete are inaccessible from your Recordset. Data changes by other users
are still visible.
adOpenDynamic (2) - With the dynamic cursor additions, changes, and
deletions by other users are visible, and all types of movement through the
Recordset are allowed,.
adOpenStatic (3) - The static cursor provides a static copy of a set
of records that you can use to find data or generate reports. Additions,
changes, or deletions by other users are not visible.
adOpenUnspecified (-1) - The cursor type is not specified
adLockBatchOptimistic (4) Indicates optimistic batch updates. Required
for batch update mode.
adLockOptimistic (3) Indicates optimistic locking, record by record. The
provider uses optimistic locking, locking records only when you call the Update
adLockPessimistic (2) Indicates pessimistic locking, record by record.
The provider does what is necessary to ensure successful editing of the records,
usually by locking records at the data source immediately after editing.
adLockReadOnly (1) Indicates read-only records. You cannot alter the
adLockUnspecified (-1) Does not specify a type of lock. For clones, the
clone is created with the same lock type as the original.
ExecuteOptionEnum - which has the following constant options:
CommandTypeEnum - which has the following constant options: