215 |
|
procedure Notification( AComponent: TComponent; Operation: TOperation); override; |
216 |
|
function GetDataset(Index : longint) : TDataset; override; |
217 |
|
function GetDataSetCount : Longint; override; |
218 |
+ |
procedure ReadState(Reader: TReader); override; |
219 |
|
procedure SetConnected (Value : boolean); override; |
220 |
|
public |
221 |
|
constructor Create(AOwner: TComponent); override; |
421 |
|
|
422 |
|
implementation |
423 |
|
|
424 |
< |
uses IBIntf, IBSQLMonitor, IBCustomDataSet, IBDatabaseInfo, IBSQL, IBUtils, typInfo; |
424 |
> |
uses IBIntf, IBSQLMonitor, IBCustomDataSet, IBDatabaseInfo, IBSQL, IBUtils, |
425 |
> |
typInfo; |
426 |
|
|
427 |
|
{ TIBDatabase } |
428 |
|
|
429 |
|
constructor TIBDatabase.Create(AOwner: TComponent); |
430 |
+ |
{$ifdef WINDOWS} |
431 |
+ |
var acp: uint; |
432 |
+ |
{$endif} |
433 |
|
begin |
434 |
|
inherited Create(AOwner); |
435 |
|
FIBLoaded := False; |
440 |
|
FTransactions := TList.Create; |
441 |
|
FDBName := ''; |
442 |
|
FDBParams := TStringList.Create; |
443 |
+ |
{$ifdef UNIX} |
444 |
+ |
if csDesigning in ComponentState then |
445 |
+ |
FDBParams.Add('lc_ctype=UTF-8'); |
446 |
+ |
{$else} |
447 |
+ |
{$ifdef WINDOWS} |
448 |
+ |
if csDesigning in ComponentState then |
449 |
+ |
begin |
450 |
+ |
acp := GetACP; |
451 |
+ |
if (acp >= 1250) and (acp <= 1254) then |
452 |
+ |
FDBParams.Values['lc_ctype'] := Format('WIN%d',[acp]); |
453 |
+ |
end; |
454 |
+ |
{$endif} |
455 |
+ |
{$endif} |
456 |
|
FDBParamsChanged := True; |
457 |
|
TStringList(FDBParams).OnChange := DBParamsChange; |
458 |
|
TStringList(FDBParams).OnChanging := DBParamsChanging; |
1212 |
|
Result := FDataSets.Count; |
1213 |
|
end; |
1214 |
|
|
1215 |
+ |
procedure TIBDataBase.ReadState(Reader: TReader); |
1216 |
+ |
begin |
1217 |
+ |
FDBParams.Clear; |
1218 |
+ |
inherited ReadState(Reader); |
1219 |
+ |
end; |
1220 |
+ |
|
1221 |
|
procedure TIBDataBase.SetConnected(Value: boolean); |
1222 |
|
begin |
1223 |
|
if StreamedConnected and not AllowStreamedConnected then |