Subject | Params bug in new release 4.3 (fix included here) |
---|---|
Author | Jason Wharton |
Post date | 2003-11-15T16:35Z |
This is a bug I fixed that got in the new release. I'm about to release a
patch for it.
Here it is for you in IBODataset.pas around line 6800:
This:
if Assigned( tmpCol ) and ( tmpCol.Row.RowType = rtParam ) then
begin
AssignParamValueToCol( AParams[ii], tmpCol );
tmpParam := FindParam( tmpCol.FullFieldName );
if Assigned( tmpParam ) and
( tmpParam.Value <> AParams[ii].Value ) then
tmpParam.Value := AParams[ii].Value;
end;
end;
should be changed to:
if Assigned( tmpCol ) and ( tmpCol.Row.RowType = rtParam ) then
begin
AssignParamValueToCol( AParams[ii], tmpCol );
tmpParam := FindParam( tmpCol.FullFieldName );
if Assigned( tmpParam ) {and
( tmpParam.Value <> AParams[ii].Value )} then
tmpParam.Value := AParams[ii].Value;
end;
end;
It was designed to keep the native param value and the TDataset TParams
values the same. It is possible to get an invalid variant exception when
comparing them if one of them is Unassigned. The compare was intended to
avoid making an assignment if they were the same values, but it appears
there isn't much done as a result of the assignment in the way of events so
this code can simply be removed.
Thanks,
Jason Wharton
patch for it.
Here it is for you in IBODataset.pas around line 6800:
This:
if Assigned( tmpCol ) and ( tmpCol.Row.RowType = rtParam ) then
begin
AssignParamValueToCol( AParams[ii], tmpCol );
tmpParam := FindParam( tmpCol.FullFieldName );
if Assigned( tmpParam ) and
( tmpParam.Value <> AParams[ii].Value ) then
tmpParam.Value := AParams[ii].Value;
end;
end;
should be changed to:
if Assigned( tmpCol ) and ( tmpCol.Row.RowType = rtParam ) then
begin
AssignParamValueToCol( AParams[ii], tmpCol );
tmpParam := FindParam( tmpCol.FullFieldName );
if Assigned( tmpParam ) {and
( tmpParam.Value <> AParams[ii].Value )} then
tmpParam.Value := AParams[ii].Value;
end;
end;
It was designed to keep the native param value and the TDataset TParams
values the same. It is possible to get an invalid variant exception when
comparing them if one of them is Unassigned. The compare was intended to
avoid making an assignment if they were the same values, but it appears
there isn't much done as a result of the assignment in the way of events so
this code can simply be removed.
Thanks,
Jason Wharton