Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flushing parameter connection settings MUST be done even if the datas… #103

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/component/ZAbstractRODataset.pas
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ TZAbstractRODataset = class(TDataSet)
procedure RaiseWriteStateError;
procedure RaiseFieldTypeMismatchError(const AField: TField; AFieldDef: TFieldDef);
procedure RaiseFieldSizeMismatchError(const AField: TField; AFieldDef: TFieldDef);
procedure SetActive(Value: Boolean); Override;
function FetchOneRow: Boolean;
function FetchRows(RowCount: Integer): Boolean;
function FilterRow(RowNo: NativeInt): Boolean;
Expand Down Expand Up @@ -2063,6 +2064,16 @@ procedure TZAbstractRODataset.RaiseFieldReadOnlyError(const Field: TField);
raise EZDatabaseError.Create(Format(SFieldReadOnly, [Field.DisplayName]));
end;

procedure TZAbstractRODataset.SetActive(Value: Boolean);
begin
inherited;

{$IFNDEF DISABLE_ZPARAM}
if (FParams <> nil) And Not Value then
FParams.FlushParameterConSettings;
{$ENDIF}
end;

procedure TZAbstractRODataset.RaiseFieldSizeMismatchError(const AField: TField;
AFieldDef: TFieldDef);
begin
Expand Down Expand Up @@ -3977,10 +3988,6 @@ procedure TZAbstractRODataset.InternalClose;
{$ENDIF}
if CurrentRows <> nil then
CurrentRows.Clear;
{$IFNDEF DISABLE_ZPARAM}
if FParams <> nil then
FParams.FlushParameterConSettings;
{$ENDIF}
end;

{**
Expand Down