The createIndex( ) method creates an index for a specified table.

Syntax

createIndex (<tablename expC>,<oRef>)

<table name expC>

The name of the table on which you want to create the index.

<oRef>

Predefined .dbf index object

Property of

Database

Description

The createIndex( ) method creates an index from an instance of a database index object. Before using createIndex( ):

Close all active queries.

The .dbf index object's name and expression properties must be defined (see following example), and cannot include calculated fields, UDFs, or, since no queries are active, fields in a lookupRowset.

ex. d=new DbfIndex()

  d.indexName="indextagname"

  d.expression="indexexpression" // other properties

  _app.databases[1].createIndex("tablename", d)