Board index » delphi » invalid index descriptor

invalid index descriptor

I have an application that works fine on my pc.  At the user
site they get the above message whenever they attempt to
create a new file.

Here is the code that creates the table:

 With TTable.Create(nil) do
    begin
      DatabaseName := ('c:\LifeSpan\Files');
      TableName    := ExtractFileName(aaNewFileFrm.NewFile);
      TableType    := ttDBase;
      with FieldDefs do
        begin
          Add ('RcdID',       ftString,   5,false);
          Add ('tiff',        ftString, 100,false);
          Add ('specimen',    ftString, 100,false);
          Add ('name',        ftString,  40,false);
          Add ('dob',         ftString,   8,false);
          Add ('ssn',         ftString,  20,false);
          Add ('Sex',         ftString,   1,false);
          Add ('Age',         ftString,   3,false);
          Add ('Year',        ftString,   4,false);
          Add ('Path1',       ftString,   2,false);
          Add ('Path2',       ftString,   2,false);
          Add ('Path3',       ftString,   5,false);
          Add ('DataSource',  ftString,  10,false);
          Add ('Diagnosis',   ftMemo,   240,false);
          Add ('Microscop',   ftMemo,   240,false);
          Add ('BadImage',    ftString,   1,false);
          Add ('keyed',       ftBoolean,  0,false);
          Add ('verified',    ftBoolean,  0,false);
        end;
        CreateTable;
        with IndexDefs do
          begin
            clear;
            AddIndex('RcdID', 'RcdID', [ixPrimary]);
          end;
    end;

Any clue as to the cause of the problem?

Any help is much appreciated,

Don

 

Re:invalid index descriptor


Quote
>don boje wrote:

>         with IndexDefs do
>           begin
>             clear;
>             AddIndex('RcdID', 'RcdID', [ixPrimary]);

A primary index has no name, so do

  AddIndex('', 'RcdID', [ixPrimary]);
________
Andreas
Delphi 5.01 Pro, WinNT4.0 Sp5
(For direct replies add '.de' to e-mail address)

Re:invalid index descriptor


Quote
>          AddIndex('RcdID', 'RcdID', [ixPrimary]);

Only Dbase 7 tables can have a primary index.  Older dbase tables do not have a
primary index.  What version of Delphi is this?   Do you have the same version
of BDE installed on both machines?  My guess is you have a BDE version and you
are not getting  a dbase 7 table.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads