TableDef.Attributes 属性 (DAO)
适用于:Access 2013、Office 2013
设置或返回一个值,该值指示 TableDef 对象的一个或多个特征。 Long 类型,可读写。
语法
表达式 .Attributes
表达式 一个表示 TableDef 对象的变量。
说明
对于尚未追加到集合中的对象,该属性是可读写的。
示例
以下示例显示 Northwind 数据库中 Field、 Relation 和 TableDef 对象的 Attributes 属性。
Sub AttributesX()
Dim dbsNorthwind As Database
Dim fldLoop As Field
Dim relLoop As Relation
Dim tdfloop As TableDef
Set dbsNorthwind = OpenDatabase("Northwind.mdb")
With dbsNorthwind
' Display the attributes of a TableDef object's
' fields.
Debug.Print "Attributes of fields in " & _
.TableDefs(0).Name & " table:"
For Each fldLoop In .TableDefs(0).Fields
Debug.Print " " & fldLoop.Name & " = " & _
fldLoop.Attributes
Next fldLoop
' Display the attributes of the Northwind database's
' relations.
Debug.Print "Attributes of relations in " & _
.Name & ":"
For Each relLoop In .Relations
Debug.Print " " & relLoop.Name & " = " & _
relLoop.Attributes
Next relLoop
' Display the attributes of the Northwind database's
' tables.
Debug.Print "Attributes of tables in " & .Name & ":"
For Each tdfloop In .TableDefs
Debug.Print " " & tdfloop.Name & " = " & _
tdfloop.Attributes
Next tdfloop
.Close
End With
End Sub