Board index » delphi » DELPHI INTERBASE / DBASE INDEX CREATION

DELPHI INTERBASE / DBASE INDEX CREATION

I want to create a dbase table with one index using the TTable object.

  MyTable is an instance of TTable :

  with MyTable do
  begin
    Active := False;
    TableName := 'c:\MyTable.dbf'
    TableType := ttdBase;
    with FieldDefs do
    begin
      Clear;
      Add('Name',    ftString, 30, False);
      Add('City',    ftString, 20, False);
      Add('Country', ftString, 20, False);
    end;
    with IndexDefs do
    begin
      Clear;
      Add('MYINDEX', 'Name;City', []);
    end;
    CreateTable;
    Open;
  end;

  At the CreateTable method call I get this error message :
  "Incorrect Index descriptor ".
  With InterBase the message is different but the result is the same.

  I have tried several other index field syntaxes, the error message
changed
  with no more success.

  What is the problem ?
  Which is the right syntax ?
  It is possible to create compound index with the CreateTable method ?
  Is there a syntax for each driver database ?

  A little help would be greatly appreciated.

  LDelnon...@aol.com

 

Re:DELPHI INTERBASE / DBASE INDEX CREATION


For a dBASE index, use a "+" rather than a ";" to key on more than one
field.

Mark Shapiro
info...@tyrell.net

Other Threads