CreateIndex Method

Creates a new Index object.

Applies to objects: TableDef.

Syntax

[[Set] RetVal = ] object.CreateIndex([Name])

The CreateIndex method syntax has these parts:

Part Description
object Required. A reference to an instance of the object.
RetVal Optional. An Index type variable.
Name Optional. A String type variable. The name of the index.

Remarks

Once a new Index object has been created, you need to create the fields of the table, on which it will be based. For each such field you need to call the CreateField method with its name and add the created object to the Fields collection by using the Append method.

The index itself will be created in the table on calling the Append method of the Indexes collection.

The index properties Primary and Unique can be defined before calling Append of the Indexes collection. In other cases their changes will be ignored.

Example

.......

 

See Also

Index Object, Indexes Object, TableDef Object, Name Property, Primary Property, Unique Property, Append Method.