当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Mode 属性
The Mode property sets or returns a ConnectModeEnum value that indicates the permission for modifying data in a Connection, Record, or Stream object. This property is read/write when an object is closed, and read-only when an object is open.
Mode属性的作用是:设置或返回一个ConnectModeEnum值,它的作用是指示是否允许在一个连接、记录或记录流对象中修改数据信息。当对象被关闭时,该属性对其有可读/可写权限;如果对象被打开后,该书行进对其有只读功能。
Note: This property can be set only when the Connection object is closed.
注意:该属性仅允许在连接关闭时设置。
object.Mode |
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Mode=adModeReadWrite conn.Open(Server.Mappath("northwind.mdb")) response.write(conn.Mode) conn.Close %> |
Constant常量 | Value值 | Description描述 |
adModeUnknown | 0 | Permissions have not been set or cannot be determined. 表明权限尚未设置或无法确定 |
adModeRead | 1 | Read-only. 权限为只读 |
adModeWrite | 2 | Write-only. 权限为只写 |
adModeReadWrite | 3 | Read/write. 权限为可读/可写 |
adModeShareDenyRead | 4 | Prevents others from opening a connection with read permissions. 防止其他用户使用读权限打开连接 |
adModeShareDenyWrite | 8 | Prevents others from opening a connection with write permissions. 防止其他用户使用写权限打开连接 |
adModeShareExclusive | 12 | Prevents others from opening a connection. 防止其他用户打开连接 |
adModeShareDenyNone | 16 | Allows others to open a connection with any permissions. 允许其他用户使用任何权限打开连接 |
adModeRecursive | 0x400000 | Used with adModeShareDenyNone, adModeShareDenyWrite, or adModeShareDenyRead to set permissions on all sub-records of the current Record. 通过使用adModeShareDenyNone、adModeShareDenyWrite或adModeShareDenyRead设置当前记录中所有子记录的权限 |