RECORDSET object method
Open method
Recordset.open Source, ActiveConnection, Cursortype, LockType, Options
Source
The Recordset object can connect the Command object via the Source property. The Source parameter can be a COMMAND object name, a SQL command, a specified data table name or a Stored ProCedure. If this parameter is omitted, the system uses the Source property of the Recordset object.
ActiveConnection
The Recordset object can connect the Connection object through the ActiveConnection property. The ActiveConnection here can be a connection object or a string parameter containing database configuration (Connectionstring).
Cursortype
The CURSORTYPE parameter of the RECORDSET object Open method represents what kind of cursor type starts data, including AdopenForward, AdoPenkey, AdoPENDYNAMIC, and AdoPenStatic, and is described below:
Constant constant value description
AdopenForwardonly 0 Default, start a cursor that can only move forward (Forward ONLY)
AdopenKeyset 1 Start a keyset type of cursor
AdoPENDYNAMIC 2 launches a Dynamic type cursor
AdoPenStatic 3 Start a cursor for a static type
The above number of cursor types will directly affect all attributes and methods of the Recordset object, and the following list describes the differences between them.
Recordset property adopenforwardonly adopenkeyset adoPENDYNAMIC AdoPenStatic
AbsolutePage does not support not support readable write readable
AbsolutePosition does not support not support readable write readable
ActiveConnection readable write readable write readable write readable
Bof read-only Read read only read only
Bookmark does not support not support readable write readable
Cachesize readable write readable write readable write readable
CursorLocation Readable Writables Readable Writing Writing Writing
CURSORTYPE readable write readable write readable write readable
EditMode reads read only read only read only
EOF read-only Read read only read only
Filter readable write readable write readable write readable
LockType readable to read-readable write-readable
Marshaloptions readable and writable readable write readable
MaxRecords readable write readable write readable write readable
PageCount does not support only read-only read only
PageSize readable write readable write readable write readable
Recordcount does not support not support read only read only
Source Readable Writable Writable Writable Writing
State Read Read Read Read Read Read
Status is read-only Read read only read only
AddNew support support support support
Cancelbatch support support support support
CancelupDate support support support support
Clone does not support
Close Support Support Support
Delete support support support support
GETROWS support support support support
MOVE does not support support support support
MoveFirst support support support support
MovelaST does not support support support support
MoveNext support support support support
MovePrevious does not support support support support
NextRecordset support support support support
Open support support support support
Requory support support support support
RESYNC does not support support support support
Supports support support support support
Update support support support UPDATEBATCH support support support support
Where the next NEXTRECORDSET method does not apply to the Microsoft Access database.
LockType
The LockType parameter of the RECORDSET object Open method indicates the Lock type to be used. If this parameter is ignored, the system will be preset with the LockType property of the Recordset object. The LockType parameter contains AdlockReadOnly, AdlockPrsSIMistic, AdlockOptimistic, and AdlockbatchOptimistic, etc., which are described below:
Constant constant value description
AdlockReadOnly 1 default, Recordset objects are started in read-only mode, unable to run AddNew, Update, and Delete.
AdlockPrsSIMistic 2 When the data source is being updated, the system is temporarily locked for other users to maintain data consistency.
AdlockOptimistic 3 When the data source is being updated, the system does not lock the action of other users, and other users can increase, delete, and change the data. AdlockBatchOptimistic 4. When the data source is being updated, other users must change the CursorLocation property. ADUDECLIENTBATCH can increase, delete, and change the data
Options
The Options parameter of the Recordset object Open method represents the type of database request, the Options parameter contains AdcmdText, AdcmdTable, AdcmdStoredProc, and AdcmDunkNown, etc., is described below:
Constant constant value description
ADCMDunknown -1 default, indicating that the specified CommandText parameter type cannot be determined
AdcmdText 1 indicates that the specified CommandText parameter is a general command type.
AdcmdTable 2 indicates that the specified CommandText parameter is a name of a table existing table.
AdcmdStoredProc 3 indicates that the specified CommandText parameter is the name of Stored Procedure