当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Seek 方法

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO Seek 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 333 ::
收藏到网摘: n/a

The Seek method searches the index of a Recordset to find a record that matches the values specified in the keyvalues parameter. If there is a match, the pointer will point to the record specified by the seekoption parameter. If there is no match, the record pointer will be placed at the end of the Recordset.
Seek的作用是:搜索一个记录集的index[索引],从中查找与keyvalues参数中指定的值相匹配的一条记录。如果找到了匹配对象,那么记录指针将指向seekoption参数指定的记录;如果未找到匹配对象,那么记录指针将定位在记录集的末尾处。

Note: To use this method, the provider must support this method and the use of indexes on a Recordset (the Index property). Use the Supports method to determine whether the provider supports seek and indexes.
注意:使用这个方法的前提是:技术提供对象[provider]必须支持这个方法,并且必须在一个记录集参数(索引[index]属性中)中使用索引[index];使用Supports方法可以用来确定技术提供对象[provider]是否支持Seek和index方法。

Note: Set the Index property to the desired index before executing this method.
注意:必须在这个方法执行之前将index属性设置为你希望的index值。

Note: This method can only be used with server-side cursors (not supported when the CursorLocation property value is adUseClient).
注意:这个方法只能用于服务器端的记录指针(当CursorLocation属性值为adUseClient时,则不能获得支持)。

Note: This method can only be used when the Recordset object was opened with the CommandTypeEnum value of adCmdTableDirect.
注意:只有当Recordset对象以adCmdTableDirect中的CommandTypeEnum值打开时,才能使用这个方法。

Syntax
语法

recordsetobj.Seek keyvalues,seekoption

Parameter参数 Description描述
keyvalues Required. An array of values to compare with the values in each column 
必要参数。指定一个用于和每一列(字段)的值进行比较的值的数组
seekoption Required. A SeekEnum value that specifies the type of seek
必要参数。指定一个SeekEnum值。这个值是用来指定Seek[查找]类型的


SeekEnum Values

Constant常量 Value值 Description描述
adSeekFirstEQ 1 Seeks the first key equal to keyvalues
查找等于 keyvalues 的第一个关键字
adSeekLastEQ 2 Seeks the last key equal to keyvalues
查找等于 keyvalues 的最后一个关键字
adSeekAfterEQ 4 Seeks either a key equal to keyvalues or just after where that match would have occurred
查找等于 keyvalues 的关键字,或仅在已经匹配过的位置之后进行查找
adSeekAfter 8 Seeks a key just after where a match with keyvalues would have occurred
仅在已经有过与 keyvalues 匹配的位置之后进行查找
adSeekBeforeEQ 16 Seeks either a key equal to keyvalues or just before where that match would have occurred
查找等于 keyvalues 的关键字,或仅在已经匹配过的位置之前进行查找
adSeekBefore 32 Seeks a key just before where a match with keyvalues would have occurred
仅在已经有过与 keyvalues 匹配的位置之前进行查找

评论 (0) All

登陆 | 还没注册?