ListIndexes Method (Professional Edition Only)

See AlsolanListIndexesSee                 ExamplelanListIndexesX>Low

Description

Creates a Snapshot1ZLURBC with one record for each field in each index1L6K9K3 in a specified table3N276AP.

 

Note   It is easier and more efficient to use the Indexes collection1WAT5K of a Table instead of this method.

 

Syntax

Set snapshot = table.ListIndexes( )

Remarks

The ListIndexes method uses these parts:

Part                 Description

 

snapshot          Object variableZ3R9Q5 for the Snapshot you want to create.

table                 Object variable identifying an existing table containing the indexes you want to list.

 

There is one record in the Snapshot for each field in each index in the table.  The Snapshot records are sorted by IndexName and (for indexes with multiple fields) field order of fields in the index.  The following table shows the Snapshot field contents.

Field                Data type           Description

 

IndexName       String                Name of the index.

FieldCount        Long                  Number of fields in the index.

IndexAttributes Long                  Numeric value for one or more attributes of the index.  See table below.

FieldName        String                Name of the field in the table.

FieldOrder        Long                  Order of the field in the index.

FieldType         Long                  Numeric value for the field data type.  See table below.

FieldAttributes  Long                  Numeric value for one or more attributes of the field.  See table below.

FieldCollatingOrder Integer         Comparison code for the current language.  Use this value for the compare argument in the StrComp and InStr functions.  See table below.

 

The values and symbolic constants (from DATACONS.TXT) for the IndexAttributes field in the Snapshot are:

Value    Constant                      Description

 

1           DB_UNIQUE                 Unique values are required.

2           DB_PRIMARY               Primary key.

4           DB_NONULLS               Indexed values cannot be Null.

8           DB_IGNORENULL         Null values are ignored by the index.

 

The values and symbolic constants (from DATACONS.TXT) for the FieldType field in the Snapshot are:

Value    Constant                      Description

 

1           DB_BOOLEAN              True/False

2           DB_BYTE                     Byte

3           DB_INTEGER               Integer

4           DB_LONG                     Long

5           DB_CURRENCY           Currency

6           DB_SINGLE                  Single

7           DB_DOUBLE                 Double

8           DB_DATE                     Date/Time

10         DB_TEXT                     Text

11         DB_LONGBINARY        Long Binary

12         DB_MEMO                    Memo

 

The values and symbolic constants (from DATACONS.TXT) for the FieldAttributes field in the Snapshot are:

Value    Constant                      Description

 

0           DB_INDEXASCEND      Index in this field is in ascending order.

1           DB_INDEXDESCEND    Index in this field is in descending order.

 

The values and symbolic constants (from CONSTANT.TXT) for the FieldCollatingOrder field in the Snapshot are:

Value    Constant                      Description

 

0           DB_SORTBINARY        Sort by binary values.

256        DB_GENERAL              Sort by EFGPI rules (English, French, German, Portuguese, Italian).

258        DB_SORTSPANISH      Sort by Spanish rules.

259        DB_SORTDUTCH         Sort by Dutch rules.

260        DB_SORTSWEDFIN     Sort by Swedish, Finnish rules.

261        DB_SORTNORWDAN   Sort by Norwegian, Danish rules.

262        DB_SORTICELANDIC   Sort by Icelandic rules.

4096      DB_SORTPDXINTL       Sort by Paradox international rules.

4097      DB_SORTPDXSWE      Sort by Paradox Swedish, Finnish rules.

4098      DB_SORTPDXNOR       Sort by Paradox Norwegian, Danish rules.

-1          DB_SORTUNDEFINED Field sort rules are undefined or unknown.

 

Values above 262 for FieldCollatingOrder are not supported by the Instr and StrComp functions.

In a Snapshot created using ListIndexes, you can determine index attributes by referring to the values in the IndexAttributes field and the IndexAttribute constants defined in DATACONS.TXT.  To determine field attributes and sort order, refer to the FieldAttributes and FieldCollatingOrder fields and the symbolic constants defined in DATACONS.TXT.

If the specified table has no indexes, and if the QueryDef has no parameters, the Snapshot will have no records.

 

Note   The Fields collection is not available in Snapshots created by the ListTables, ListFields, ListIndexes, and ListParameters methods; therefore, you can't access the field values using an index into the Fields collection.  To access the field values you must explicitly use the name of each field.

You can't use the Find methods, such as FindFirst, on a Snapshot created with this method.