w3pop.com :: 网络学院 :: ADO :: ADO CursorType 属性
The CursorType property sets or returns the cursor type to use when opening a Recordset object. This property can take a CursorTypeEnum value. Default is adOpenForwardOnly.
CursorType属性的作用是:设置或返回了用于打开一个记录集对象的指针类型。该属性可以是CursorTypeEnum中的其中一个值。默认值为adOpenForwardOnly。
Note: If the CursorLocation property is set to adUseClient, the only valid setting for the CursorType property is adOpenStatic.
注意:如果CursorLocation属性值被设置为adUseClient,那么对于CursorType属性的有效属性值仅能设置为adOpenStatic。
Note: No error will occur if an unsupported value is set, the provider will just change to a supported CursorType instead.
注意:如果设置了一个不受支持的值,那么将会产生一个错误。技术提供对象[provider]将会自动将其改变为受支持的CursorType。
objRecordset.CursorType |
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
sql="SELECT * FROM Customers"
rs.CursorLocation = adUseClient rs.CursorType = adOpenStatic rs.LockType = adLockBatchOptimistic rs.Open sql, conn %> |
| Constant常量 | Value值 | Description描述 |
|---|---|---|
| adOpenUnspecified | -1 | Does not specify the type of cursor. 不指定指针类型 |
| adOpenForwardOnly | 0 | Default. Uses a forward-only cursor. Identical to a static cursor, except that you can only scroll forward through records. This improves performance when you need to make only one pass through a Recordset. 仅向前移动指针,默认值。除了只能在记录中向前滚动外,与静态指针相同。当只需要在记录集中单向移动时,使用它可提高性能。(顾名思义,这种指针只能向前移动。然而,由于这种指针功能有限,将它用于系统资源时是非常有效的。) |
| adOpenKeyset | 1 | Uses a keyset cursor. Like a dynamic cursor, except that you can't see records that other users add, although records that other users delete are inaccessible from your Recordset. Data changes by other users are still visible. 键集指针。尽管从您的记录集不能访问其他用户删除的记录,但除无法查看其他用户添加的记录外,键集指针与动态指针相似。仍然可以看见其他用户更改的数据。(KeySet指针允许你看见自它创建起其他用户所做的修改,然而你却不能看到其他用户增加或删除的记录。) |
| adOpenDynamic | 2 | Uses a dynamic cursor. Additions, changes, and deletions by other users are visible, and all types of movement through the Recordset are allowed, except for bookmarks, if the provider doesn't support them. 动态指针。可以看见其他用户所作的添加、更改和删除。允许在记录集中进行所有类型的移动,但不包括提供者不支持的书签操作。(此类型的指针功能强大同时也是耗费系统资源最多的指针。Dynamic指针可以看到他们保存记录集合的所有变化。使用Dynamic指针的用户可以看到其他用户所做的编辑、增加、删除。如果数据提供者允许这种类型的指针,那么它是通过每隔一段时间从数据源重取数据来支持这种可视性的。毫无疑问这会需要很多的资源。 ) |
| adOpenStatic | 3 | Uses a static cursor. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible. 动态指针。可以看见其他用户所作的添加、更改和删除。允许在记录集中进行所有类型的移动,但不包括提供者不支持的书签操作。(此类型的指针功能强大同时也是耗费系统资源最多的指针。Dynamic指针可以看到他们保存记录集合的所有变化。使用Dynamic指针的用户可以看到其他用户所做的编辑、增加、删除。如果数据提供者允许这种类型的指针,那么它是通过每隔一段时间从数据源重取数据来支持这种可视性的。毫无疑问这会需要很多的资源。 ) |
评论 (0)
All