Bewerken

Delen via


Index Object (ADOX)

Represents an index from a database table.

Remarks

The following code creates a new Index:

Dim obj As New Index  

With the properties and collections of an Index object, you can:

  • Identify the index with the Name property.

  • Access the database columns of the index with the Columns collection.

  • Specify whether the index keys must be unique with the Unique property.

  • Specify whether the index is the primary key for a table with the PrimaryKey property.

  • Specify whether records that have null values in their index fields have index entries with the IndexNulls property.

  • Specify whether the index is clustered with the Clustered property.

  • Access provider-specific index properties with the Properties collection.

Note

An error will occur when appending a Column to the Columns collection of an Index if the Column does not exist in a Table object already appended to the Tables collection.

Note

Your data provider may not support all properties of Index objects. An error will occur if you have set a value for a property that is not supported by the provider. For new Index objects, the error will occur when the object is appended to the collection. For existing objects, the error will occur when setting the property.

Note

When creating Index objects, the existence of an appropriate default value for an optional property does not guarantee that your provider supports the property. For more information about which properties your provider supports, see your provider documentation.

This section contains the following topic.

See Also

Indexes Append Method Example (VB)
IndexNulls Property Example (VB)
PrimaryKey and Unique Properties Example (VB)
SortOrder Property Example (VB)
Columns Collection (ADOX)
Indexes Collection (ADOX)
Properties Collection (ADO)