还可以在代码中对这个查找属性的SQL语句赋值。
with TSQLDataSet(DataSetBroker1.DataSet) do
begin
Close;
BizFieldByName('SZDW').LookDef.SQL.Text := 'SELECT DISTINCT T_WLDY.GYSBH, T_GYSXX.GYSMC, T_GYSXX.CZ FROM T_WLDY,T_GYSXX where substring(T_WLDY.WLBH,1,1)='''+zhi+''' and T_WLDY.GYSBH=T_GYSXX.GYSBH ';
Open;
end;
取消查找的代码:
var
lBizField: TBizField;
begin
lBizField := TBizDataSet(DataSetBrokerBZSJJ1.DataSet).FindBizField('SZ');
if lBizField <> nil then
begin
lBizField.LookupDef.Kind := TLookupKind.lkNone;
TBizDataSet(DataSetBrokerBZSJJ1.DataSet).LayoutChange;
end
else
FindBizFieldError;
end;