larand
larand

Reputation: 831

Delphi, Firedac TFDTable.CreateTable doesn't exist

I have DELPHI-XE6 and tried to use FireDacs TFDTable.CreateTable to create a db-table but it say's "TFDTable does not contain a member with name CreateTable".

Is that so that XE6 is to old or what? The code looks like:

function TDataModule1.crtTable(const aTblName: string;
  const aFlds: TStringList): boolean;
var
  Table: TFDTable;
begin
  Table := TFDTable.Create(nil);
  try
    Table.Connection := FDConnection1;
    { specify table name }
    Table.TableName := aTblName;
    { add some fields }
    Table.FieldDefs.Add('ID', ftInteger, 0, False);
    Table.FieldDefs.Add('Name', ftString, 50, False);
    { define primary key index }
    Table.AddIndex('pkMyTableID', 'ID', '', [soPrimary]);
    { and create it; when the first parameter is True, an existing one is dropped }
    Table.CreateTable(False);
  finally
    Table.Free;
  end;
end;

Upvotes: 0

Views: 824

Answers (1)

nil
nil

Reputation: 1328

This might not be the most accurate method, but based on the Embarcadero documentation, I would say it has been introduced with XE7. It seems TFDTable wasn't moved and is in the same namespace - FireDAC.Comp.Client - in both versions, so the links depending on version should be:

XE7 documentation of FireDAC.Comp.Client.TFDTable.CreateTable - Page exists with basic info

XE6 documentation of FireDAC.Comp.Client.TFDTable.CreateTable - nothing

To verify I looked at the method list for TFDTable in XE6, with no match found.

Upvotes: 1

Related Questions