Changeset 7 for trunk/UCore.pas


Ignore:
Timestamp:
Jan 20, 2015, 11:33:39 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: XML database can be opened from file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r6 r7  
    1313
    1414  TCore = class(TDataModule)
     15    APreferences: TAction;
    1516    AExit: TAction;
    1617    ActionList1: TActionList;
     
    99100  I: Integer;
    100101  NewDatabase: TDatabase;
     102  Engine: TDatabaseEngine;
    101103begin
    102104  Databases.Count := XMLConfig1.GetValue('Database/Count', 0);
    103105  for I := 0 to Databases.Count - 1 do begin
     106    Engine := Core.Engines.FindByName(XMLConfig1.GetValue('Database/Item' + IntToStr(I) + '/Engine', ''));
     107
    104108    NewDatabase := TDatabase.Create;
     109    NewDatabase.Engine := Engine;
    105110    NewDatabase.Name := XMLConfig1.GetValue('Database/Item' + IntToStr(I) + '/Name', '');
    106111    NewDatabase.ConnectionString := XMLConfig1.GetValue('Database/Item' + IntToStr(I) + '/ConnectionString', '');
    107     NewDatabase.Engine := Core.Engines.FindByName(XMLConfig1.GetValue('Database/Item' + IntToStr(I) + '/Engine', ''));
    108112    Databases[I] := NewDatabase;
    109113  end;
Note: See TracChangeset for help on using the changeset viewer.