Changeset 21 for trunk/UCore.pas
- Timestamp:
- Mar 23, 2018, 3:06:47 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r20 r21 87 87 88 88 procedure TCore.ADatabaseConnectExecute(Sender: TObject); 89 var90 NewClient: TDbClient;91 89 begin 92 90 if FormDatabases.ShowModal = mrOk then begin 93 91 DbClient := nil; 94 NewClient := FormDatabases.SelectedProfile.ClientType.DatabaseClientClass.Create; 95 NewClient.ConnectProfile := FormDatabases.SelectedProfile; 96 DbClient := NewClient; 92 DbClient := FormDatabases.SelectedProfile.GetClient; 97 93 end; 98 94 end; … … 134 130 DbClient.Load; 135 131 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; 139 133 end; 140 134 UpdateInterface; … … 186 180 UpdateInterface; 187 181 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; 191 186 end else ADatabaseConnect.Execute; 192 187 end; … … 196 191 begin 197 192 SaveConfig; 193 DbClient := nil; 198 194 end; 199 195
Note:
See TracChangeset
for help on using the changeset viewer.