Ignore:
Timestamp:
Mar 26, 2018, 12:40:10 AM (7 years ago)
Author:
chronos
Message:
  • Modified: More changes to implement SQL over XML file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DbEngines/UEngineMySQL.pas

    r21 r23  
    1616    procedure LoadFields(Table: TTable);
    1717  protected
    18     procedure LoadTables(Tables: TTables); override;
    1918  public
    2019    SqlDatabase: TSqlDatabase;
     
    102101end;
    103102
    104 procedure TDatabaseMySQL.LoadTables(Tables: TTables);
    105 var
    106   DbRows: TDbRows;
    107   NewTable: TTable;
    108   I: Integer;
    109 begin
    110   DbRows := TDbRows.Create;
    111   try
    112     SqlDatabase.Query(DbRows, 'SELECT `Id`,`Name`,`Title` FROM `Model`');
    113     for I := 0 to DbRows.Count - 1 do begin
    114       NewTable := TTable.Create;
    115       NewTable.Id := StrToInt(TDictionaryStringString(DbRows[I]).Values['Id']);
    116       NewTable.DbClient := Self;
    117       NewTable.Name := TDictionaryStringString(DbRows[I]).Values['Name'];
    118       NewTable.Caption := TDictionaryStringString(DbRows[I]).Values['Title'];
    119       LoadFields(NewTable);
    120       Tables.Add(NewTable);
    121     end;
    122   finally
    123     DbRows.Free;
    124   end;
    125 end;
    126 
    127103procedure TDatabaseMySQL.Query(Text: string; DbRows: TDbRows = nil);
    128104begin
Note: See TracChangeset for help on using the changeset viewer.