Changeset 21 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 23, 2018, 3:06:47 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Allow to create and remove tables for XML backend.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r20 r21  
    8787
    8888procedure TCore.ADatabaseConnectExecute(Sender: TObject);
    89 var
    90   NewClient: TDbClient;
    9189begin
    9290  if FormDatabases.ShowModal = mrOk then begin
    9391    DbClient := nil;
    94     NewClient := FormDatabases.SelectedProfile.ClientType.DatabaseClientClass.Create;
    95     NewClient.ConnectProfile := FormDatabases.SelectedProfile;
    96     DbClient := NewClient;
     92    DbClient := FormDatabases.SelectedProfile.GetClient;
    9793  end;
    9894end;
     
    134130    DbClient.Load;
    135131    Preferences.LastDatabaseName := FDbClient.ConnectProfile.Name;
    136     if not Assigned(FormTables.Tables) then
    137       FormTables.Tables := TTables.Create;
    138     DbClient.LoadTables(FormTables.Tables);
     132    FormTables.DbClient := DbClient;
    139133  end;
    140134  UpdateInterface;
     
    186180    UpdateInterface;
    187181    if Preferences.RememberDatabase then begin
    188       ConnectProfile := DbManager.ConnectProfiles.FindByName(Preferences.LastDatabaseName);
    189       if Assigned(ConnectProfile) then
    190         DbClient := ConnectProfile.ClientType.DatabaseClientClass.Create;
     182      ConnectProfile := DbManager.ConnectProfiles.SearchByName(Preferences.LastDatabaseName);
     183      if Assigned(ConnectProfile) then begin
     184        DbClient := ConnectProfile.GetClient;
     185      end;
    191186    end else ADatabaseConnect.Execute;
    192187  end;
     
    196191begin
    197192  SaveConfig;
     193  DbClient := nil;
    198194end;
    199195
Note: See TracChangeset for help on using the changeset viewer.