Changeset 30 for trunk/UDatabase.pas
- Timestamp:
- Jun 28, 2024, 11:08:43 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UDatabase.pas
r29 r30 4 4 5 5 uses 6 Classes, SysUtils, ExtCtrls, Dialogs, USqlDatabase, URegistry, UGenerics,6 Classes, SysUtils, ExtCtrls, Dialogs, USqlDatabase, RegistryEx, Generics, 7 7 Generics.Collections; 8 8 … … 347 347 try 348 348 CurrentContext := Context; 349 Count := GetValue('Count', 0);349 Count := ReadIntegerWithDefault('Count', 0); 350 350 for I := 0 to Count - 1 do begin 351 351 OpenKey(Context.Key + '\Item' + IntToStr(I), True); 352 ClientType := DbManager.ClientTypes.FindByName( GetValue('ClientType', ''));352 ClientType := DbManager.ClientTypes.FindByName(ReadStringWithDefault('ClientType', '')); 353 353 if not Assigned(ClientType) and (DbManager.ClientTypes.Count > 0) then 354 354 ClientType := TDbClientType(DbManager.ClientTypes[0]); … … 357 357 ConnectProfile.DbManager := DbManager; 358 358 ConnectProfile.ClientType := ClientType; 359 ConnectProfile.Name := GetValue('Name', '');360 ConnectProfile.Params.ConnectionString := GetValue('ConnectionString', '');359 ConnectProfile.Name := ReadStringWithDefault('Name', ''); 360 ConnectProfile.Params.ConnectionString := ReadStringWithDefault('ConnectionString', ''); 361 361 Items[I] := ConnectProfile; 362 362 end; … … 373 373 try 374 374 CurrentContext := Context; 375 SetValue('Count', Count);375 ReadIntegerWithDefault('Count', Count); 376 376 for I := 0 to Count - 1 do begin 377 377 OpenKey(Context.Key + '\Item' + IntToStr(I), True); 378 SetValue('Name', Items[I].Name);379 SetValue('ConnectionString', Items[I].Params.ConnectionString);380 SetValue('ClientType', Items[I].ClientType.Name);378 WriteString('Name', Items[I].Name); 379 WriteString('ConnectionString', Items[I].Params.ConnectionString); 380 WriteString('ClientType', Items[I].ClientType.Name); 381 381 end; 382 382 finally
Note:
See TracChangeset
for help on using the changeset viewer.