Changeset 23 for trunk/DbEngines/UEngineMySQL.pas
- Timestamp:
- Mar 26, 2018, 12:40:10 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DbEngines/UEngineMySQL.pas
r21 r23 16 16 procedure LoadFields(Table: TTable); 17 17 protected 18 procedure LoadTables(Tables: TTables); override;19 18 public 20 19 SqlDatabase: TSqlDatabase; … … 102 101 end; 103 102 104 procedure TDatabaseMySQL.LoadTables(Tables: TTables);105 var106 DbRows: TDbRows;107 NewTable: TTable;108 I: Integer;109 begin110 DbRows := TDbRows.Create;111 try112 SqlDatabase.Query(DbRows, 'SELECT `Id`,`Name`,`Title` FROM `Model`');113 for I := 0 to DbRows.Count - 1 do begin114 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 finally123 DbRows.Free;124 end;125 end;126 127 103 procedure TDatabaseMySQL.Query(Text: string; DbRows: TDbRows = nil); 128 104 begin
Note:
See TracChangeset
for help on using the changeset viewer.