DBIAddIndex "baseorder" error

I need to add index to a paradox table when the user clicks on the field
title.  Because there isnt a PrimaryIndex on the table, I have to add a
NonMaintained index.  Of course the help file say that the TTable.AddIndex
method works with an [ixNonMaintained] IndexOption, but the VCL source has
no such option.  SO, I therefore have to use the DBIAddIndex function from
the BDE API.  Well, It works fine for the first index I add, but every index
after that give the following error: "Must use baseorder for this operation.
Index: index_name".  This error occurs on the DBIAddIndex call.  I cant find
any information about this error and Im getting nowhere.  Here is my code if
it helps:

procedure TfrmQman.grdRESULTSTitleButtonClick(Sender: TObject; AFieldName:
   NDX:      IDXDesc;
   StrPCopy(NDX.szName, 'ix_'+AFieldName);
   NDX.iIndexId         := 0;
   NDX.bPrimary         := False;
   NDX.bUnique          := False;
   NDX.bDescending      := False;
   NDX.bMaintained      := False;
   NDX.bSubset          := False;
   NDX.bExpIdx          := False;
   NDX.iFldsInKey       := 1;
   NDX.aiKeyFld[0]      := RESULTS.FieldDefs.IndexOf(AFieldName) + 1;
   NDX.bCaseInsensitive := True;
   Check(DbiAddIndex(RESULTS.dbhandle, RESULTS.handle, nil, nil, NDX, nil));

Please help!!!  What am I doing wrong????

Click here to reply via email: mob...@himark.com