ExcelWork.info

フィールド名(ADO)Fields コレクション

Fields コレクション

Recordset オブジェクト内の1つ以上の列(フィールド)を表すオブジェクト(Field オブジェクト)で構成されています。各 Field オブジェクト に関しての詳細は、フィールド名(ADO)Field オブジェクト を参照して下さい。


Count プロパティ

Recordset オブジェクト内の Fields コレクションが持つ Field オブジェクトの数を取得します。

【書式】

<取得>
object.Fields.Count


引数・戻り値

  • object  ・・・  対象となる Recordset オブジェクトを指定します。
  • 戻り値  ・・・  Recordset オブジェクト内の列数を返します。

Item プロパティ

Field オブジェクトを取得します。

【書式】

<取得>
object.Fields[.Item](index)
object.Fields[.Item](“name“)
object(index)
object(“name“)
object![name]


引数・戻り値

  • object  ・・・  対象となる Recordset オブジェクトを指定します。


Fields コレクション 使用例

サンプルVBAソース


実行結果