Changeset 103 for trunk/Packages/CoolWeb/Persistence/USqlDatabase.pas
- Timestamp:
- Oct 8, 2012, 8:48:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CoolWeb/Persistence/USqlDatabase.pas
r99 r103 52 52 procedure SetConnected(const AValue: Boolean); 53 53 procedure SetDatabase(const Value: string); 54 procedure SetEncoding(AValue: string); 54 55 public 55 56 LastUsedTable: string; … … 84 85 property Password: string read FPassword write FPassword; 85 86 property Port: Word read FPort write FPort; 86 property Encoding: string read FEncoding write FEncoding;87 property Encoding: string read FEncoding write SetEncoding; 87 88 property OnLogQuery: TLogEvent read FOnLogQuery write FOnLogQuery; 88 89 end; … … 198 199 try 199 200 Rows := TDbRows.Create; 200 Query(Rows, 'SET NAMES ' + Encoding);201 Query(Rows, 'SET NAMES ' + FEncoding); 201 202 finally 202 203 Rows.Free; … … 452 453 end; 453 454 455 procedure TSqlDatabase.SetEncoding(AValue: string); 456 var 457 Rows: TDbRows; 458 begin 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; 469 end; 470 454 471 function TSqlDatabase.EscapeString(Text: string): string; 455 472 var
Note:
See TracChangeset
for help on using the changeset viewer.