1、在adodataset的create事件中设置<br> MasterDataLink.OnMasterChange := MasterChanged;<br>2、当master表的master字段数据发生变化时<br>procedure TCustomADODataSet.MasterChanged(Sender: TObject);<br>begin<br> ............<br> RefreshParams;<br>end;<br>3、在RefreshParams中调用了SetParamsFromCursor<br>procedure TCustomADODataSet.RefreshParams;<br>begin<br> .................<br> SetParamsFromCursor;<br> Requery;<br> ..........<br>end;<br>4、在SetParamsFromCursor进行赋值<br>procedure TCustomADODataSet.SetParamsFromCursor;<br>var<br> I: Integer;<br>begin<br> if MasterDataLink.DataSource <> nil then<br> for I := 0 to MasterDataLink.Fields.Count - 1 do<br> with TField(MasterDataLink.Fields) do<br> Parameters.ParamByName(FieldName).Assign(MasterDataLink.Fields);<br>end;<br>5、完毕。