Announcement

Collapse
No announcement yet.

Erstellen von Indizes auf dBASE(7)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Erstellen von Indizes auf dBASE(7)

    Hilfe !
    Ich muß per Laufzeit dBASE-Tabellen erzeugen (dBASE7) und diese auch entsprechend indizieren. Ich verwende dazu TQueries. Das funktioniert aber nicht bei Indizes, die sich auf mehrere Spalten beziehen

    z.B.
    CREATE UNIQUE INDEX index1 ON kunden (NR1, NR2)

    Bei Paradox-Tabellen klappt alles anstandslos. Leider muß ich dBASE-Tabellen verwenden. Wer hat einen Tip.

    Tojo

  • #2
    Hallo,

    Borland hat zu diesem Problem eine <b>Technical Information</b> (TI2838) veröffentlich. Der folgende Auszug demonstriert das Anlegen eines zusammengesetzten Indexes für eine dBASE-Tabelle:

    <i>dBASE indexes can be created programmatically iin Delphi applications, either as a new table is being created (CreateTable method of the TTable component) or by adding an index to an existing table. Creating an index as part of a new table being created is a matter of calling the Add method for the IndexDefs property of the TTable. A special consideration that the index options must include the option ixExpression. This index option is unique to dBASE indexes, and should only be used with dBASE expression indexes. For example: </i>
    <pre>
    with Table1 do begin
    Active := False;
    DatabaseName := 'Delphi_Demos';
    TableName := 'CustInfo';
    TableType := ttdBASE;
    with FieldDefs do begin
    Clear;
    Add('LastName', ftString, 30, False);
    Add('FirstName', ftString, 20, False);
    end;
    with IndexDefs do begin
    Clear;
    Add('FullName', 'LastName + FirstName', [ixExpression]);
    end;
    CreateTable;
    end;
    </pre>

    <i>Adding an index to an existing table is accomplished by calling the Add-Index method of the TTable. Again, the index options must include the TIndexOptions value ixExpression. </i&gt

    Comment

    Working...
    X