Board index » delphi » Master-Detail problem with tquery as detail

Master-Detail problem with tquery as detail

There's a refresh problem of db-aware components in the DBCtrls unit that
use TFieldDataLink, when there's a TQuery as detail (with any TDataSet as
master).
When the master dataset scrolls, such components are not refreshed properly
if I assign the fields of the detail at design time.
In fact I have to enter these components to have them refreshed.

Assuming that for me it's important to have the fields created at design
time, the solution may come in changing the procedure
TFieldDataLink.SetField, deleting the test "if FField <> Value...".
Does anyone agree?
Andrea

 

Re:Master-Detail problem with tquery as detail


Change UpdateField to

procedure TFieldDataLink.UpdateField;
begin
  if Active and (FFieldName <> '') then
  begin
    FField := nil;
    if Assigned(FControl) then
      SetField(GetFieldProperty(DataSource.DataSet, FControl, FFieldName)) else
      SetField(DataSource.DataSet.FieldByName(FFieldName));
  end else
    SetField(nil);
end;

to fix this problem.  That's where the problem really lies.  The SetField was a
side effect to a bug in the UpdateField procedure.

Quote
Andrea Buso wrote:

> There's a refresh problem of db-aware components in the DBCtrls unit that
> use TFieldDataLink, when there's a TQuery as detail (with any TDataSet as
> master).
> When the master dataset scrolls, such components are not refreshed properly
> if I assign the fields of the detail at design time.
> In fact I have to enter these components to have them refreshed.

> Assuming that for me it's important to have the fields created at design
> time, the solution may come in changing the procedure
> TFieldDataLink.SetField, deleting the test "if FField <> Value...".
> Does anyone agree?
> Andrea

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The bond that links your true family is not one of {*word*76}, but of respect and joy
in each others life.  Rarely do members of one family grow up under the same
roof.   (R Bach)

Re:Master-Detail problem with tquery as detail


Thanks Jeff.

Other Threads