当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Filter 属性

ADO
ADO介绍
ADO数据库连接
ADO记录集
ADO显示记录
ADO查询语句
ADO记录排序
ADO添加记录
ADO更新记录
ADO删除记录
ADO演示
ADO提升执行速度
ADO Command对象
ADO Connection对象
ADO Error
ADO Field
ADO Parameter
ADO 属性
ADO Record
ADO Recordset
ADO Stream

ADO Filter 属性


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

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:
“数据过滤器”的属性可以是以下几个值中的一个:

  • A criteria string
    一个用于指示规则标准的字符串
  • An array of bookmarks
    一个书签数组
  • A FilterGroupEnum value
    一个FilterGroupEnum值

Examples of a criteria string:
规则字符串举例:

  • rs.Filter="Lastname='Smith'"
  • rs.Filter="Lastname='Smith' AND Birthdate >= #4/10/70#"
  • rs.Filter="Lastname ='Jonson' OR Lastname='Johnson'"
  • rs.Filter= "Lastname LIKE Jon*"
  • rs.Filter="[Company Name]='Alfred Futterkiste' OR Orders>$300.00"

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属性被清除后,记录指针将移动到未过滤记录集中的第一条记录。

Syntax
语法

objRecordset.Filter


FilterGroupEnum Values

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
允许查看在上一次批更新中失败的记录

评论 (0) All

登陆 | 还没注册?