Prototype:
Recordset. Open source, activeconnection, cursortype, locktype, options
Parameters:
The first parameter is an SQL statement.
Number 2: Conn, that is, database connection
Third parameter: cursortype | cursor type
-1 -- adopenunspecified: does not specify the type of cursor.
0 -- adopenfowardonly: The cursor can only be forward, creating a read-only record set that can only be rolled forward.
1 -- adopenkeyset: The cursor can be forward or backward. The cursor allows you to add, delete, and modify records, but you cannot see any changes made to your record set by other users.
2 -- adopendynamic: the cursor is dynamic and free. The cursor allows you to add, delete, and modify records, and you can see the modifications made by other users.
3 -- adopenstatic: the record set does not reflect any changes made to other users.
Fourth parameter: locktype | lock type:
1 -- adlockreadoney: records in the record set cannot be modified.
2 -- adlockpessimistic: Lock a record when it is edited
3 -- adlockoptimstic: The record is locked only when the record set update method is called.
4 -- adlockbatchopeimstic: records can only be updated in batches.
Fifth parameter: Options
- commandtypeenum
1 -- ad1_text: indicates that the provider should calculate commandtext according to the command text definition (such as SQL statement.
2 -- adcmdtable: indicates that ADO should generate an SQL query to return all rows from a commandtext-named table.
512 -- adcmdtabledirect: indicates that the provider should return all rows from the table named commandtext.
4 -- adw.storedproc: indicates that the provider should calculate commandtext Based on the stored procedure.
8 -- adcmdunknown: indicates that the command type in commandtext is unknown.
256 -- ad1_file: indicates that recordset should be restored (saved) from the file named in source.
- executeoptionenum
adasyncexecute: indicates that the source should be executed asynchronously.
adasyncfetch: indicates that all remaining rows should be extracted asynchronously after the initial quantity specified in the initial fetch size attribute is extracted. If the required row has not been extracted, the main thread will be blocked until the row is available again.
adasyncfetchnonblocking: indicates that the main thread is not blocked during extraction. If the requested row has not been extracted, the current row is automatically moved to the end of the file.