TZAbstractRODataset in ZAbstractRODataset

In this forum all bug reports concerning the 6.x branch will be gahtered. You have the possibility to track the bug fix process.

Moderators: EgonHugeist, mdaems

Post Reply
damien666
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.09.2005, 09:10

TZAbstractRODataset in ZAbstractRODataset

Post by damien666 »

hi
i use SVN Testing 188

the parameter FParamCheck is only used in
constructor TZAbstractRODataset.Create(AOwner: TComponent);

it can be removed


i use TZReadOnlyQuery to do a lot of insert in postgres (with TZReadOnlyQuery ) and sometime there is a exception in

Code: Select all

procedure TZAbstractRODataset.SetStatementParams(Statement: IZPreparedStatement;
  ParamNames: TStringDynArray; Params: TParams; DataLink: TDataLink);
var
  I: Integer;
  TempParam, Param: TParam;
  Stream: TStream;
  Dataset: TDataset;
  Field: TField;
begin
  if DataLink.Active then
    Dataset := DataLink.DataSet
  else Dataset := nil;

  TempParam := TParam.Create(nil); //<< The exception is raise by rtl
but for inserting data i use ParamCheck := false

For the problem is here

Code: Select all

procedure TZAbstractRODataset.ExecSQL;
begin
  Connection.ShowSQLHourGlass;
  try
    if Active then Close;

    CheckSQLQuery;
    CheckInactive;
    CheckConnected;

    if (Statement = nil) or (Statement.GetConnection.IsClosed) then
      Statement := CreateStatement(FSQL.Statements[0].SQL, Properties);

      // alway check params !!
      SetStatementParams(Statement, FSQL.Statements[0].ParamNamesArray,
        FParams, FDataLink);

    FRowsAffected := Statement.ExecuteUpdatePrepared;
  finally
    Connection.HideSQLHourGlass;
  end;
end;
i have fix the problem for me but i don't know if it's can break somethink else

Code: Select all

procedure TZAbstractRODataset.ExecSQL;
begin
  Connection.ShowSQLHourGlass;
  try
    if Active then Close;

    CheckSQLQuery;
    CheckInactive;
    CheckConnected;

    if (Statement = nil) or (Statement.GetConnection.IsClosed) then
      Statement := CreateStatement(FSQL.Statements[0].SQL, Properties);

    if( ParamCheck ) then
      SetStatementParams(Statement, FSQL.Statements[0].ParamNamesArray,
        FParams, FDataLink);

    FRowsAffected := Statement.ExecuteUpdatePrepared;
  finally
    Connection.HideSQLHourGlass;
  end;
end;
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

BonjourDamien,

I just don't know enough about this to judge if your solution is OK. The FParamcheck parameter will be removed soon, however.

Mark
Post Reply