Ignore:
Timestamp:
Oct 8, 2012, 8:48:16 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: TWebSession zobecněno pro možnost implementace více modulů s obsluhou vstupní stránky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CoolWeb/Persistence/USqlDatabase.pas

    r99 r103  
    5252    procedure SetConnected(const AValue: Boolean);
    5353    procedure SetDatabase(const Value: string);
     54    procedure SetEncoding(AValue: string);
    5455  public
    5556    LastUsedTable: string;
     
    8485    property Password: string read FPassword write FPassword;
    8586    property Port: Word read FPort write FPort;
    86     property Encoding: string read FEncoding write FEncoding;
     87    property Encoding: string read FEncoding write SetEncoding;
    8788    property OnLogQuery: TLogEvent read FOnLogQuery write FOnLogQuery;
    8889  end;
     
    198199  try
    199200    Rows := TDbRows.Create;
    200     Query(Rows, 'SET NAMES ' + Encoding);
     201    Query(Rows, 'SET NAMES ' + FEncoding);
    201202  finally
    202203    Rows.Free;
     
    452453end;
    453454
     455procedure TSqlDatabase.SetEncoding(AValue: string);
     456var
     457  Rows: TDbRows;
     458begin
     459  if FEncoding = AValue then Exit;
     460  FEncoding := AValue;
     461  if Connected then begin
     462    try
     463      Rows := TDbRows.Create;
     464      Query(Rows, 'SET NAMES ' + FEncoding);
     465    finally
     466      Rows.Free;
     467    end;
     468  end;
     469end;
     470
    454471function TSqlDatabase.EscapeString(Text: string): string;
    455472var
Note: See TracChangeset for help on using the changeset viewer.