ADOフィルタープロパティ
❮完全なレコードセットオブジェクトリファレンス
Filterプロパティは、Recordsetオブジェクトのデータのフィルターを含むバリアントを設定または返します。フィルタを使用すると、特定の基準に一致するレコードを選択できます。
Filterプロパティには、次のいずれかを含めることができます。
- 基準文字列
- ブックマークの配列
- FilterGroupEnum 値_
基準文字列の例:
- rs.Filter = "Lastname = 'Smith'"
- rs.Filter = "Lastname = 'Smith' AND Birthdate> =#4/10/70#"
- rs.Filter = "Lastname = 'Jonson' OR Lastname = 'Johnson'"
- rs.Filter = "姓LIKE'Jon * '"
- rs.Filter = "[会社名] = 'AlfredFutterkiste'または注文> $ 300.00"
ブックマークの配列の例:
dim fname(10)
fname(2)= rs.Bookmark
rs.Filter = fname(2)
Filterプロパティが設定されている場合、カーソルはフィルターされたレコードセットの最初のレコードに移動します。また、Filterプロパティがクリアされると、カーソルはフィルタリングされていないRecordsetの最初のレコードに移動します。
構文
objRecordset.Filter
FilterGroupEnum値
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 |
adFilterFetchedRecords | 3 | Filter that displays the records in the current cache |
adFilterConflictingRecords | 5 | Filter that displays those records that failed the last batch update |
❮完全なレコードセットオブジェクトリファレンス