Changeset 30 for trunk/UDatabase.pas


Ignore:
Timestamp:
Jun 28, 2024, 11:08:43 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UDatabase.pas

    r29 r30  
    44
    55uses
    6   Classes, SysUtils, ExtCtrls, Dialogs, USqlDatabase, URegistry, UGenerics,
     6  Classes, SysUtils, ExtCtrls, Dialogs, USqlDatabase, RegistryEx, Generics,
    77  Generics.Collections;
    88
     
    347347  try
    348348    CurrentContext := Context;
    349     Count := GetValue('Count', 0);
     349    Count := ReadIntegerWithDefault('Count', 0);
    350350    for I := 0 to Count - 1 do begin
    351351      OpenKey(Context.Key + '\Item' + IntToStr(I), True);
    352       ClientType := DbManager.ClientTypes.FindByName(GetValue('ClientType', ''));
     352      ClientType := DbManager.ClientTypes.FindByName(ReadStringWithDefault('ClientType', ''));
    353353      if not Assigned(ClientType) and (DbManager.ClientTypes.Count > 0) then
    354354        ClientType := TDbClientType(DbManager.ClientTypes[0]);
     
    357357      ConnectProfile.DbManager := DbManager;
    358358      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', '');
    361361      Items[I] := ConnectProfile;
    362362    end;
     
    373373  try
    374374    CurrentContext := Context;
    375     SetValue('Count', Count);
     375    ReadIntegerWithDefault('Count', Count);
    376376    for I := 0 to Count - 1 do begin
    377377      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);
    381381    end;
    382382  finally
Note: See TracChangeset for help on using the changeset viewer.