字段对象Field Object

表示数据类型为通用数据类型的列。Represents a column of data with a common data type.

备注Remarks

每个 字段 对象都对应于 记录集中的一列。Each Field object corresponds to a column in the Recordset. 使用 Field 对象的 Value属性可以设置或返回当前记录的数据。You use the Value property of Field objects to set or return data for the current record. 根据提供程序公开的功能, 字段 对象的某些集合、方法或属性可能不可用。Depending on the functionality the provider exposes, some collections, methods, or properties of a Field object may not be available.

使用 Field 对象的集合、方法和属性,可以执行以下操作:With the collections, methods, and properties of a Field object, you can do the following:

  • 返回具有 name 属性的字段的名称。Return the name of a field with the Name property.

  • 查看或更改 " " 属性字段中的数据。View or change the data in the field with the Value property. Field 对象的默认属性。Value is the default property of the Field object.

  • 返回具有 类型精度NumericScale 属性的字段的基本特征。Return the basic characteristics of a field with the Type, Precision, and NumericScale properties.

  • 返回具有 DefinedSize 属性的字段的声明大小。Return the declared size of a field with the DefinedSize property.

  • 使用 ActualSize 属性返回给定字段中数据的实际大小。Return the actual size of the data in a given field with the ActualSize property.

  • 使用 特性 属性和 属性 集合确定给定字段支持的功能类型。Determine what types of functionality are supported for a given field with the Attributes property and Properties collection.

  • AppendChunkGetChunk 方法操作包含长二进制或长字符数据的字段的值。Manipulate the values of fields containing long binary or long character data with the AppendChunk and GetChunk methods.

  • 如果提供程序支持批更新,则在批处理更新过程中通过 OriginalValueUnderlyingValue 属性解析字段值中的差异。If the provider supports batch updates, resolve discrepancies in field values during batch updating with the OriginalValue and UnderlyingValue properties.

在打开 字段 对象的 记录集 之前,所有元数据属性 (名称类型DefinedSize精度NumericScale) 都可用。All of the metadata properties (Name, Type, DefinedSize, Precision, and NumericScale) are available before opening the Field object's Recordset. 此时设置它们对于动态构造窗体非常有用。Setting them at that time is useful for dynamically constructing forms.

本部分包含以下主题。This section contains the following topic.

另请参阅See Also

字段集合 (ADO) Fields Collection (ADO)
ADO) (属性集合 Properties Collection (ADO)
记录集对象 (ADO)Recordset Object (ADO)