Object | Detailed Open method
Recordset. Open source,activeconnection,cursortype,locktype,options
Source
The Recordset object can connect to the command object through the Source property. The source parameter can be a command object name, a section of SQL command, a specified data table name, or a stored Procedure. If this argument is omitted, the system takes the source property of the Recordset object.
ActiveConnection
The Recordset object can connect connection objects by ActiveConnection properties. The ActiveConnection can be a connection object or a string parameter containing the database connection information (ConnectionString).
CursorType
The CursorType parameter of the Recordset object Open method indicates what cursor type will start the data, including adOpenForwardOnly, adOpenKeyset, adOpenDynamic, and adOpenStatic. It is described as follows:
Constants Constant Numerical description
adOpenForwardOnly 0 defaults to start a cursor that can only be moved forward (Forward only)
adOpenKeyset 1 launches a keyset type of cursor
adOpenDynamic 2 launches a dynamic-type cursor
adOpenStatic 3 launches a static type of cursor
These cursor types will directly affect all properties and methods of the Recordset object, and the following list illustrates the differences between them.
Recordset Properties adOpenForwardOnly adOpenKeyset adopendynamic adOpenStatic
AbsolutePage does not support read-write writable
AbsolutePosition does not support read-write writable
ActiveConnection can read, write, read, write, read and write
BOF read-only read-only read-only
Bookmark does not support read-write writable
CacheSize can read, write, read, write, read and write
CursorLocation can read, write, read, write, read and write
CursorType can read, write, read, write, read and write
EditMode read-only read-only read-only
EOF read-only read-only read-only
Filter can read, write, read, write, read and write
LockType can read, write, read, write, read and write
MarshalOptions can read, write, read, write, read and write
MaxRecords can read, write, read, write, read and write
PageCount does not support read-only read-only
PageSize can read, write, read, write, read and write
RecordCount does not support read-only read-only
Source can read, write, read, write, read and write
State read-only read-only read-only
Status read-only read-only read-only
AddNew Support Support
CancelBatch Support Support
CancelUpdate Support Support
Clone does not support unsupported
Close support support for support
Delete Support support for support
GetRows Support Support
Move does not support support support
MoveFirst Support Support
MoveLast support Support support is not supported
MoveNext Support Support
MovePrevious support Support support is not supported
NextRecordset Support Support
Open Support support supporting support
Requery Support Support Support support
Unsupported support support is not supported by Resync
Supports Support Support
Update Support support supporting support
UpdateBatch Support Support
Where the NextRecordset method does not apply to Microsoft Access databases.
LockType
The LockType parameter of the Recordset object's Open method represents the lock type to take, and if this argument is omitted, then the system takes the LockType property of the Recordset object as the preset value. The LockType parameters include adLockReadOnly, adlockprssimistic, adLockOptimistic, and adLockBatchOptimistic, as described below:
Constants Constant Numerical description
adLockReadOnly 1 defaults, the Recordset object starts as read-only and cannot run AddNew, Update, and Delete methods
Adlockprssimistic 2 When the data source is being updated, the system temporarily locks the actions of other users to maintain data consistency
adLockOptimistic 3 When the data source is being updated, the system does not lock the actions of other users, other users can add, delete, change the operation of the data
adLockBatchOptimistic 4 When the data source is being updated, other users must change the CursorLocation property to Adudeclientbatch to add, delete, and modify the data
Options
The options parameter of the Recordset object's Open method represents the type of request to the database, and the options parameter contains adCmdText, adCmdTable, adCmdStoredProc, and adCmdUnknown, which are described as follows:
Constants Constant Numerical description
AdCmdUnknown-1 The default value indicating that the specified CommandText parameter type cannot be determined
adCmdText 1 indicates that the specified CommandText parameter is a generic command type
adCmdTable 2 indicates that the specified CommandText parameter is the name of a table that exists
adCmdStoredProc 3 indicates that the CommandText parameter specified is the name of the stored procedure