当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Filter 属性
The Filter property sets or returns a variant that contains a filter for the data in a Recordset object. The filter allows you to select records that fit a specific criteria.
Filter属性的作用是:用于筛选记录对象中的数据的过滤器。该“数据过滤器[filter]”可以使你按照一个具体的规则标准选取记录。
The Filter property can contain one of the following:
“数据过滤器”的属性可以是以下几个值中的一个:
Examples of a criteria string:
规则字符串举例:
Example of an array of bookmarks:
书签数组举例:
dim fname(10)
fname(2)=rs.Bookmark
rs.Filter=fname(2)
When the Filter property is set, the cursor moves to the first record in the filtered Recordset. And, when the Filter property is cleared, the cursor moves to the first record in the unfiltered Recordset.
当设置了Filter属性之后,指针将移动到被过筛选后记录集中的第一条记录。当Filter属性被清除后,记录指针将移动到未过滤记录集中的第一条记录。
objRecordset.Filter |
Constant常量 | Value值 | Description描述 |
---|---|---|
adFilterNone | 0 | Removes the current filter 清除当前筛选并恢复所有记录以便查看 |
adFilterPendingRecords | 1 | Filter that displays only edited records that have not yet been sent to the server 允许只查看已更改且尚未发送到服务器的记录 |
adFilterAffectedRecords | 2 | Filter that displays only records affected by the last Delete, Resync, UpdateBatch, or CancelBatch call 允许只查看上一次 Delete、Resync、UpdateBatch 或CancelBatch 调用所影响的记录 |
adFilterFetchedRecords | 3 | Filter that displays the records in the current cache 允许查看当前缓冲区中的记录,即上一次从数据库中检索记录的调用结果 |
adFilterConflictingRecords | 5 | Filter that displays those records that failed the last batch update 允许查看在上一次批更新中失败的记录 |