IndexDefs.Add('Help','Please',[ixD2WorksGreat, ixD3Errors])

IndexDefs.Add('Help','Please',[ixD2WorksGreat, ixD3Errors])

Post by Randy Trexle » Sun, 31 Dec 1899 09:00:00

I've got a strange problem when I create a table at runtime....Before
installing Delphi 3 and the next version of BDE, the following code works
like a charm.

With FTable Do begin
     DatabaseName := FDestinationPath;
     TableName := NewTableName;
     TableType := ttDbase;

     {Define the Field Definition and Index Definition for the new Database
     for i := 0 To FKeys.Count - 1 Do begin
        key := FKeys.strings[i];
        if FieldDefs.IndexOf(Key) < 0 Then begin
           FieldDefs.Add(Key, ftString, 50, False);
           if i=0 then
              IndexDefs.Add('Primary', Key, [ixPrimary, ixDescending])
              IndexDefs.Add(Key, Key, [ixDescending]);
     FieldDefs.Add('Data', ftMemo, 240, False);  {** Memo **}
     {Create the bastud!}

after I install Delphi 3 and the new BDE, AND
whether or not I use D2 or D3 to compile this code,
the FTable.CreateTable method errors with the following error message:

"Project prcg_abw.exe raised exception class EDBEngineError with message
'Invalid Index Descriptor.  File:  Archive.__X'. Process stopped.  Use Step
or Run to continue."

The names of the indexes that are being created are "Name", "Claim", "SSN"

Did I miss something in Delphi 3's release notes about a change in how BDE
handles Index Definitions b/c this is ridiculous?!? Your help would greatly
be appreciated otherwise I will have to uninstall D3 and reinstall D2 just
to compile this application <which I've done once already>.