当前位置:网站首页>ASP rs.open SQL, Conn, what does 3, 1 stand for in 3,1?
ASP rs.open SQL, Conn, what does 3, 1 stand for in 3,1?
2022-07-25 00:36:00 【Hua Weiyun】
RecordSet Medium open The complete grammar is
SecordSet.Open Source,ActiveConnection,CursorType,LockType,Options
for example : rs.open sql,conn,1,3
CursorType yes
adOpenForwardOnly 0 Default cursor type , To open the forward cursor , You can only move forward in the recordset .
adOpenKeyset 1 Open the cursor of keyset type , You can move forward or backward in the recordset . If other users modify or delete a record , The recordset will reflect this change . however , If another user adds a new record , New records will not appear in the recordset .
AdOpenDynamic 2 Open dynamic cursor , You can move forward or backward in the recordset . Any changes in records caused by other records will be reflected in the record set .
adOpenStatic 3 Open the static cursor , You can move forward or backward in the recordset . however , Static cursors will not reflect changes in records caused by other users .
LockType yes
adLockReadOnly 1 Read-only lock , Specify that the records in the recordset cannot be modified .
adLockPrssimistic 2 Protective locking , When editing a record , Lock it now .
adLockOptimistic 3 Open lock , Specifies that only the calling recordset Update() Method to lock the record .
adLockBatchOptimistic 4 Open batch locking , Specified records can only be updated in batches .
The two most commonly used methods :
rs.open sql,conn,1,1 ' When reading display data , read-only
rs.open sql,conn,1,3 ' When updating or inserting data , Reading and writing
The following is the supplement of other netizens
recordset.Open Source,ActiveConnection,CursorType,LockType,Options
It can be written. :
rs.open SQL sentence ,conn object ,3( cursor type ),2( Locking method )
Source
Recordset Objects can pass through Source Property to connect Command object .Source The parameter can be a Command Object name 、 a section SQL command 、 A specified data table name or a Stored Procedure. If you omit this parameter , The system uses Recordset Object's Source attribute .
ActiveConnection
Recordset Objects can pass through ActiveConnection Property to connect Connection object . there ActiveConnection It could be a Connection Object or a string containing database Connection information (ConnectionString) String parameter of .
CursorType
Recordset object Open Methodical CursorType The parameter indicates what cursor type the data will be started with , Include adOpenForwardOnly、adOpenKeyset、adOpenDynamic And adOpenStatic, It is described as follows :
| constant | Constant value | explain |
| adOpenForwardOnly | 0 The default value | Start a cursor that can only move forward (Forward Only) |
| adOpenKeyset | 1 | Start a Keyset Cursor of type |
| adOpenDynamic | 2 | Start a Dynamic Cursor of type |
| adOpenStatic | 3 | Start a Static Cursor of type |
The above cursor types will directly affect Recordset All properties and methods of the object , The following list shows the differences between them .
| Recordset attribute | adOpenForwardOnly | adOpenKeyset | adOpenDynamic | adOpenStatic |
| AbsolutePage | I won't support it | I won't support it | read-write | read-write |
| AbsolutePosition | I won't support it | I won't support it | read-write | read-write |
| ActiveConnection | read-write | read-write | read-write | read-write |
| BOF | read-only | read-only | read-only | read-only |
| Bookmark | I won't support it | I won't support it | read-write | read-write |
| CacheSize | read-write | read-write | read-write | read-write |
| CursorLocation | read-write | read-write | read-write | read-write |
| CursorType | read-write | read-write | read-write | read-write |
| EditMode | read-only | read-only | read-only | read-only |
| EOF | read-only | read-only | read-only | read-only |
| Filter | read-write | read-write | read-write | read-write |
| LockType | read-write | read-write | read-write | read-write |
| MarshalOptions | read-write | read-write | read-write | read-write |
| MaxRecords | read-write | read-write | read-write | read-write |
| PageCount | I won't support it | I won't support it | read-only | read-only |
| PageSize | read-write | read-write | read-write | read-write |
| RecordCount | I won't support it | I won't support it | read-only | read-only |
| Source | read-write | read-write | read-write | read-write |
| State | read-only | read-only | read-only | read-only |
| Status | read-only | read-only | read-only | read-only |
| AddNew | Support | Support | Support | Support |
| CancelBatch | Support | Support | Support | Support |
| CancelUpdate | Support | Support | Support | Support |
| Clone | I won't support it | I won't support it | I won't support it | I won't support it |
| Close | Support | Support | Support | Support |
| Delete | Support | Support | Support | Support |
| GetRows | Support | Support | Support | Support |
| Move | I won't support it | Support | Support | Support |
| MoveFirst | Support | Support | Support | Support |
| MoveLast | I won't support it | Support | Support | Support |
| MoveNext | Support | Support | Support | Support |
| MovePrevious | I won't support it | Support | Support | Support |
| NextRecordset | Support | Support | Support | Support |
| Open | Support | Support | Support | Support |
| Requery | Support | Support | Support | Support |
| Resync | I won't support it | I won't support it | Support | Support |
| Supports | Support | Support | Support | Support |
| Update | Support | Support | Support | Support |
| UpdateBatch | Support | Support | Support | Support |
among NextRecordset The method does not apply to Microsoft Access database .
LockType
Recordset object Open Methodical LockType The parameter represents the... To be used Lock type , If you ignore this parameter , Then the system will Recordset Object's LockType Property is the default .LockType Parameters include adLockReadOnly、adLockPrssimistic、adLockOptimistic And adLockBatchOptimistic etc. , It is described as follows :
| constant | Constant value | explain |
| adLockReadOnly | 1 The default value | Recordset Object starts as read-only , Unable to run AddNew、Update And Delete Other methods |
| adLockPrssimistic | 2 | When the data source is being updated , The system will temporarily lock 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 data 、 Delete 、 Change the operation |
| adLockBatchOptimistic | 4 | When the data source is being updated , Other users must CursorLocation Attribute to adUdeClientBatch To add to the data 、 Delete 、 Change the operation |
Link to the original text :https://www.mimisucai.com/teach/java/35770.html
边栏推荐
- Why do I have to clean up data?
- Server intranet and Extranet
- Measurement and Multisim Simulation of volt ampere characteristics of circuit components (engineering documents attached)
- [Bert] transformer/bert/attention interview questions and answers
- js && ||
- Automated test series selenium three kinds of waiting for detailed explanation
- Click the "native practice" search box to expand the special effect so that you can realize it. How will you realize it?
- EF core :自引用的组织结构树
- 痛并快乐的-NIO编程
- 2022 Henan Mengxin League game 2: Henan University of technology K - Rice
猜你喜欢
![[untitled]](/img/8a/c51328240e28459e98aedcf107c0a3.png)
[untitled]

js && ||

Heavy forecast! Analysys, together with Microsoft and the Central University of Finance and economics, talks about the digital economy

【无标题】

3. Pressure test

What can testers do when there is an online bug?

Pain and happiness -nio programming

ROS manipulator movelt learning notes 3 | kinect360 camera (V1) related configuration

BGP机房和BGP

WPF implements RichTextBox keyword query highlighting
随机推荐
mysql初次安装的root密码是什么
[mindspore ascend] [user defined operator] graph_ In mode, customize how to traverse tensor
Unity+photon self made multiplayer TPS game
Leetcode 1260. two dimensional grid migration: two solutions (k simulations / one step)
Redis6.2 SYSTEMd startup prompt redis service: Failed with result ‘protocol‘.
asp rs.open sql,conn,3,1中3,1代表什么?
The model needs to use two losses_ FN, how to operate?
WPF implements RichTextBox keyword query highlighting
Implement a avatar looping control
SQL file import database - Nanny level tutorial
[help] mindspire training based on ascend910 cannot reproduce the model effect on GPU
进程的几种状态
Use es to realize fuzzy search and search recommendation of personal blog
Codeworks round 651 (Div. 2) ABCD solution
ROS manipulator movelt learning notes 3 | kinect360 camera (V1) related configuration
Quartus:17.1版本的Quartus安装Cyclone 10 LP器件库
[untitled]
Quartus: install cyclone 10 LP device library for quartus version 17.1
px rem em
jquer $(‘div li‘) $(‘div,li‘) $(‘div>li‘) $(‘div‘,‘li‘)