Ask for advice, about access and php $ Conn = new com ("ADODB. Connection ");
$ Connstr = "DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ =". realpath ("magazine. mdb ");
$ Conn-> Open ($ connstr );
$ Rs = new com ("ADODB. RecordSet ");
$ Rs-> Open ("select * from db_CirculatePlay", $ conn, 1, 1 );
?>
$ Rs-> Open ("select * from db_CirculatePlay", $ conn,); what does this statement mean?
Reply to discussion (solution)
Cursor type .....
The Recordset object's Open method prototype: Open ([Source], [ActiveConnection], [CursorType], [LockType], [Options]) CursorType cursor type: const adOpenForwardOnly = 0 forward cursor, which is the default cursor and provides the fastest running performance. Use it to open recordset and get all results from the right to the end. It does not support backward scrolling and only allows one-way moving between results. Const adOpenKeyset = 1 static cursor, which reflects the data status in the table when the cursor is opened for the first time. the cursor cannot identify whether the data rows in the underlying table have been updated, deleted, or added to new data. However, unlike the continent logo that can only be moved forward, the static cursor can scroll before and after the result. Const adOpenDynamic = 2 keyboard-driven cursor, which can be used to query some changes of the underlying data rows in the table, but not all. In particular, it can accurately reflect whether data has been updated. However, it cannot identify whether other users have deleted data rows (the deleted data rows will leave holes in the recordset ). The keyboard-driven cursor supports scrolling between results. Const adOpenStatic = 3 dynamic cursor, which is the most abundant cursor type. When the cursor is opened, you can query any table changes made by other users and scroll. LockType lock type: Const adLockReadOnly = 1 default lock type. read-only locking allows multiple users to read the same data at the same time, but cannot change the data. Const adLockPessimistic = 2 open the data object in pessimistic locking mode. This method is assumed that other users will access the data when you edit the record. Once you edit the record, other users cannot access the data. Const adLockOptimistic = 3 open data objects in optimistic locking mode. This method assumes that no other user accesses the data when you edit the record. Before the change is completed, other users cannot access the record. Const adLockBatchOptimistic = 4 this type of Options parameter is used when multiple rows of batch processing are updated: The Options parameter indicates the type of the command string used to open the record set. Telling ADO about the content of the executed string helps to efficiently execute this command string. AdCMDTable. The executed string contains the name of a table. AdCMDText. The executed string contains a command text. AdCMDStoredProc. The executed string contains a stored procedure name. AdCMDUnknown. The content of a string is not specified. (This is the default value .)
$ Rs-> Open ("select * from db_CirculatePlay", $ conn,); Excuse me, of this statement
Among them, 1, 1, the first 1 is the cursor type, and the last 1 is the lock type:
The cursor type has four optional values: 0, 1, and 2. the default value is 0.
0 indicates that only forward cursors are allowed. pagination, Recordset, and BookMark are not supported.
1 indicates a key set cursor. modifications made to records by other users are reflected in the record set, but the addition or deletion of records by other users is not reflected in the record set. Supports paging, Recordset, and BookMark
2. dynamic cursors support all functions, but are the most resource-consuming
3 indicates a static cursor. any modification made to the record description, adding or deleting a record, will not be reflected in the record set. Supports moving forward or backward
Optional values of the lock type include 1, 2, 3, and 4.
1 indicates read-only and does not allow any modification to the record set.
2. it means pessimistic locking. The record is locked immediately upon modification, which is more resource-consuming.
3 indicates optimistic locking. the record set is locked only when the Update method is called.
4. it means not locking. modification, insertion, and deletion are completed in the batch processing mode.
If I get the correct answer, please give it to me !~~
$ Rs-> Open ("select * from db_CirculatePlay", $ conn,); Excuse me, of this statement
Among them, 1, 1, the first 1 is the cursor type, and the last 1 is the lock type:
The cursor type has four optional values: 0, 1, and 2. the default value is 0.
0 indicates that only forward cursors are allowed. pagination, Recordset, and BookMark are not supported.
1 indicates a key set cursor. modifications made to records by other users are reflected in the record set, but the addition or deletion of records by other users is not reflected in the record set. Supports paging, Recordset, and BookMark
2. dynamic cursors support all functions, but are the most resource-consuming
3 indicates a static cursor. any modification made to the record description, adding or deleting a record, will not be reflected in the record set. Supports moving forward or backward
Optional values of the lock type include 1, 2, 3, and 4.
1 indicates read-only and does not allow any modification to the record set.
2. it means pessimistic locking. The record is locked immediately upon modification, which is more resource-consuming.
3 indicates optimistic locking. the record set is locked only when the Update method is called.
4. it means not locking. modification, insertion, and deletion are completed in the batch processing mode.
If I get the correct answer, please give it to me !~~
Sorry, I gave you 40 points when I closed the post, but I don't know how to get a satisfactory answer.