creating secondary index in paradox table at runtime??
"I recently discovered that with Paradox tables, secondary indexes must
have the same name as the field that you're indexing on"
Whoa! I don't think this is true.
To answer the original question: use AddIndex. For example,
Say Table1 has fields named Code, Product, Price, Surname, FirstName,
Date1, Date2
and the primary index is on Code.
To create a secondary index use:
procedure AddAnIndex;
var MyIndexName, FieldList:string; Options: TIndexOptions;
begin
MyIndexName:= 'AnyNameYouLike';
FieldList:='Surname;FirstName'; {for DBase use: FieldList:='Surname +
FirstName';}
Options:= []; {for a DBase expression index use: Options:= [ixExpression];}
Table1.AddIndex(MyIndexName, FieldList, Options);
end;
{TIndexOptions = set of (ixPrimary, ixUnique, ixDescending,
ixCaseInsensitive, ixExpression);}
--
Paul Motyer 17:31 Thurs, 5th September, 1996 EST
SoftStuff, Croydon, Vic, Australia, 3136.
Quote:
> > i am trying (i stress trying) to provide a data export feature in a
> > program. the problem lies in creating the secondary indexes required
by
> > the other software package. i can create the table, the key, and pump
in
> > the data, but the secondary index definition remains a mystery. any
clues
> > would be appreciated.
> > thanx
> I recently discovered that with Paradox tables, secondary indexes must
> have the same name as the field that you're indexing on. So, if your
> field is 'LASTNAME', the secondary index must also be 'LASTNAME'.
> Probably not a problem if you're using the Database Desktop/Explorer.
> However, I was creating my tables and indexes at run-time, as you
> indicate.
> Hope this helps.
> Brent DeShazer