IDXDesc characteristics by driver

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

IDXDesc characteristics by driver

Return to chapter overview

Tags in dBASE and FoxPro production multiple index files

For index tags in dBASE production multiple index files (*.MDX) and FoxPro compressed index files (*.CDX), the IDXDesc structure requires the following elements:

TypeIDXd

Name

Value

Description

DBITBLNAME

szName

Ignored


UINT16

iIndexId

Ignored


DBINAME

szTagName

10 character name

Name for index; required

DBINAME

szFormat

Ignored


BOOL

bPrimary

FALSE

Is primary; required

BOOL

bUnique

TRUE/FALSE

Is unique; required

BOOL

bDescending

TRUE/FALSE

Is descending; required

BOOL

bMaintained

TRUE

Is maintained; required

BOOL

bSubset

TRUE/FALSE

Is subset; required

BOOL

bExpIdx

TRUE/FALSE

Is expression; must be TRUE if iFldsInKey is not supplied

UINT16

iCost

Ignored


UINT16

iFldsInKey

1

Number of fields in composite index; required if bExpIdx is FALSE

UINT16

iKeyLen

Ignored


BOOL

bOutofDate

Ignored


UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld

Field number; required if iFldsInKey is  supplied and bExpIdx is FALSE

DBIKEYEXP

szKeyExp

Expression for expression index; required if bExpIdx is set to TRUE

DBIKEYEXP

szKeyCond

Condition for subset index; required if bSubset is set to TRUE

BOOL

bCaseInsensitive

FALSE

Case-insensitive index; required

UINT16

iBlockSize

Block size in bytes; optional


UINT16

iRestrNum

Ignored


UINT16

iUnUsed[16]

Unused space


 

dBASE multiple index files (*.MDX) have the following general characteristics:

_bm0A production index is considered part of the family.
_bm0A production index has the same name as the table.
_bm0Up to 47 indexes are allowed in the index file.
_bm0Tags in a production index are always maintained.
_bm0A index tag can be ascending or descending.
_bm0Index subset conditions are available.

 

Tags in dBASE and FoxPro non-production multiple index files

For dBASE non-maintained .MDX-style indexes and FoxPro .CDX-style compressed indexes (version 2.0, 2.5, and 2.6), the IDXDesc structure has the following elements:

Type

Name

Value

Description

DBITBLNAME

szName

<any_name>.MDX

except

<tbl_name>.MDX

  or

<any_name>.CDX

except

<tbl_name>.CDX

Index name; required

UINT16

iIndexId

Ignored


DBINAME

szTagName

Name for index; required


DBINAME

szFormat

Ignored


BOOL

bPrimary

FALSE

Is primary; required

BOOL

bUnique

TRUE/FALSE

Is unique; required

BOOL

bDescending

TRUE/FALSE

Is descending; required

BOOL

bMaintained

FALSE

Is maintained; required

BOOL

bSubset

TRUE/FALSE

Is subset; required

BOOL

bExpIdx

TRUE/FALSE

Is expression; must be TRUE if iFldsInKey is not supplied

UINT16

iFldsInKey

1

Number of fields in composite index; required if bExpIdx is FALSE

UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld

Field number in composite index; required if iFldsInKey is supplied and bExpIdx is FALSE

DBIKEYEXP

szKeyExp

Expression for expression index; required if bExpIdx is set to TRUE

DBIKEYEXP

szKeyCond

Condition for subset index; required if bSubset is set to TRUE

BOOL

bCaseInsensitive

FALSE

Case insensitive index; required

UINT16

iBlockSize

Block size in bytes; optional


UINT16

iRestrNum

Restructure number

Restructure number

UINT16

iUnUsed[16]

Unused space


 

Special case, non-maintained dBASE .MDX indexes have the following characteristics:

_bm0Up to 47 indexes are allowed in a single .MDX file.
_bm0All indexes are maintained when the .MDX file is opened.
_bm0The multiple index file must be manually opened.
_bm0The multiple index file cannot have the same name as the table.
_bm0Both ascending and descending order may be used.
_bm0Index subset conditions are available.
_bm0Both the index name and the tag name are required to use the index.

Naming convention: <any_name>.MDX, except <tbl_name>.MDX, or <tbl_name>.11X where the table is called <tbl_name>.111.

dBASE III PLUS-style non-maintained indexes

For dBASE non-maintained .NDX style indexes, the IDXDesc structure requires the following elements:

Type

Name

Value

Description

DBITBLNAME

szName

Any 8-character

name and extension.

Extension is usually

.NDX.

Index name; required

UINT16

iIndexId

Ignored


DBINAME

szTagName

Ignored


DBINAME

szFormat

Ignored


BOOL

bPrimary

FALSE

Is primary; required

BOOL

bUnique

TRUE/FALSE

Is unique; required

BOOL

bDescending

FALSE

Is descending; required

BOOL

bMaintained

FALSE

Is maintained; required

BOOL

bSubset

Ignored


BOOL

bExpIdx

TRUE/FALSE

Is expression; must be TRUE if iFldsInKey is not supplied

UINT16

iFldsInKey

1

Number of fields in composite index; required if bExpIdx is FALSE

UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld

Field number; required if iFldsInKey is given and bExpIdx is FALSE


DBIKEYEXP

szKeyExp

Expression for expression index; required if bExpIdx is TRUE


DBIKEYEXP

szKeyCond

Ignored


BOOL

bCaseInsensitive

FALSE

Case-insensitive index; required

UINT16

iBlockSize

Ignored


UINT16

iRestrNum

Restructure number


UINT16

iUnUsed[16]

Unused space


 

dBASE non-maintained .NDX style indexes have the following general characteristics:

_bm0Each .NDX file represents one index.
_bm0The non-maintained index file always as a .NDX filename extension.
_bm0Only ascending order is allowed.
_bm0The index is maintained only when the index is explicitly opened.
_bm0Only the index name is required to use the index.

General Paradox specifications

For Paradox primary indexes (bPrimary = TRUE), the IDXDesc structure has the following elements:

Type

Name

Value

Description

DBITBLNAME

szName

Ignored


UINT16

iIndexId

Must be 0


DBINAME

szTagName

Ignored


DBINAME

szFormat

Ignored


BOOL

bPrimary

TRUE

Is primary; required

BOOL

bUnique

TRUE

Is unique; required

BOOL

bDescending

FALSE

Is descending; required

BOOL

bMaintained

TRUE

Is maintained; required

BOOL

bSubset

FALSE

Is subset; required

BOOL

bExpIdx

FALSE

Is expression; required

UINT16

iFldsInKey

1 to 16

Number of fields in composite index; required

UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld


Array of field numbers in composite index; required

DBIKEYEXP

szKeyExp

Ignored


DBIKEYEXP

szKeyCond

Ignored


BOOL

bCaseInsensitive

FALSE

Case-insensitive index; required

UINT16

iBlockSize

Block size in bytes


UINT16

iRestrNum

Restructure number


UINT16

iUnUsed[16]

Unused space


 

Paradox primary indexes have the following general characteristics:

_bm0The index must start from the first field.
_bm0The index is always case-sensitive, maintained, and unique.

The following invalid settings for Paradox primary indexes (bPrimary = TRUE) return an error message to the application:

Setting

Solution

iIndexId is not set to 0

Primary ID must be is set to 0.

bUnique is set to FALSE

Must be TRUE.

bDescending is set to TRUE

Must be FALSE.

bMaintained is set to   FALSE

Must be TRUE.

bSubset is set to   TRUE

Must be FALSE.

bExpIdx is set to   TRUE

Must be FALSE.

iFldsInKey is 0 or greater than 16

Must be 1 to 16.

aiKeyFld

BLOB fields cannot be indexed; defined fields must be available; field cannot be used more than once in index.

szKeyCond is not set to NULL

Not available.

bCaseInsensitive is set to TRUE

Must be FALSE.

Paradox 3.5 specifications

For Paradox 3.5-style indexes, the IDXDesc structure has the following elements:

Type

Name

Value

Description

DBITBLNAME

szName

Ignored


UINT16

iIndexId

Ignored


DBINAME

szTagName

Ignored


DBINAME

szFormat

Ignored


BOOL

bPrimary

FALSE

Is primary; required

BOOL

bUnique

FALSE

Is unique; required

BOOL

bDescending

FALSE

Is descending; required

BOOL

bMaintained

TRUE/FALSE

Is maintained; required

BOOL

bSubset

FALSE

Is subset; required

BOOL

bExpIdx

FALSE

Is expression; required

UINT16

iFldsInKey

1

Number of fields in index; single field only; required

UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld

1

Array of field numbers in index; single field only; required

DBIKEYEXP

szKeyExp

Ignored


DBIKEYEXP

szKeyCond

Ignored


BOOL

bCaseInsensitive

TRUE/FALSE

Case-insensitive index; required

UINT16

iBlockSize

Block size in bytes


UINT16

iRestrNum

Restructure number


UINT16

iUnUsed[16]

Unused space


 

Paradox 3.5 style indexes have the following general characteristics:

_bm0Each index can have only one field.
_bm0Up to 255 indexes are allowed.
_bm0Indexes can be maintained (primary is required) or non-maintained.
_bm0The index name becomes the field name.
_bm0The index ID is used to reference the index or the field name.
_bm0If the index is maintained, it is maintained at all times. All indexes are opened when the table is opened.

The following invalid settings for Paradox 3.5 style indexes return an error message to the application:

Setting

Solution

bUnique is set to TRUE

Must be FALSE.

bDescending is set to TRUE

Must be FALSE.

bSubset is set to TRUE

Must be FALSE.

bExpIdx is set to TRUE

Must be FALSE.

iFldsInKey is 0 or greater than 1

Must be 1.

aiKeyFld

BLOB fields can’t be indexed; defined fields must be available; field cannot be used more than once in index.

bCaseInsensitive is set to TRUE

Must be FALSE.

Paradox 4-7 specifications

For Paradox 4.0, 5.0, and 7.0 style indexes, the IDXDesc structure has the following elements:

Type

Name

Value

Description

DBITBLNAME

szName

Index name; required


UINT16

iIndexId

Ignored


DBINAME

szTagName

Ignored


DBINAME

szFormat

Ignored


BOOL

bPrimary

FALSE

Is primary; required

BOOL

bUnique

FALSE

Is unique; required

BOOL

bDescending

TRUE/FALSE

Is descending; required (TRUE valid for Paradox 7.0 indexes only)

BOOL

bMaintained

TRUE/FALSE

Is maintained; required

BOOL

bSubset

FALSE

Is subset; required

BOOL

bExpIdx

FALSE

Is expression; required

UINT16

iFldsInKey

1

Number of fields in index; single field only; required

UINT16

iKeyExpType

Ignored


DBIKEY

aiKeyFld

1

Array of field numbers in index; single field only; required

DBIKEYEXP

szKeyExp

Ignored


DBIKEYEXP

szKeyCond

Ignored


BOOL

bCaseInsensitive

TRUE/FALSE

Case-insensitive index; required

UINT16

iBlockSize

Block size in bytes


UINT16

iRestrNum

Restructure number


UINT16

iUnUsed[16]

Unused space


 

Paradox 4.0 and 5.0 style indexes have the following general characteristics:

_bm0Both maintained (primary is required) and non-maintained indexes are allowed.
_bm0Indexes may be case-sensitive, or case-insensitive.
_bm0A composite index can have more than one field.
_bm0Only the index name is required to reference the index
_bm0Up to 320 indexes are allowed.
_bm0If the index is maintained, it is maintained at all times. All indexes are opened when the table is opened.

The following invalid settings for Paradox 4.0 and 5.0 style indexes return an error message to the application:

Setting

Solution

szName is set to NULL

Name required to find index.

bUnique is set to TRUE

Must be FALSE.

bDescending is set to TRUE

Must be FALSE.

bSubset is set to TRUE

Must be FALSE.

bExpIdx is set to TRUE

Must be FALSE.

iFldsInKey is 0 or greater than 16

Must be 1 to 16.

aiKeyFld

BLOB fields can’t be indexed; defined fields must be available; field cannot be used more than once in index.

Paradox naming conventions

The following naming conventions must be followed for Paradox indexes:

Index Type

Naming convention

Non-composite

Same as field name.

Non-composite, case-insensitive

Any legal name. Must be unique. A field name can be used if not already used by a non-composite index.

Composite

Any legal name not used as a field name. Must be unique. A field name can be used if not already used by a non-composite index.

 

Paradox 7.0 style indexes follow the same conventions as Paradox 4.0 and 5.0 style indexes except bDescending can be TRUE or FALSE.