clientdataset过滤报错问题???(100)

  • 主题发起人 主题发起人 zgjob
  • 开始时间 开始时间
Z

zgjob

Unregistered / Unconfirmed
GUEST, unregistred user!
这是我的一个过滤代码:过滤分类下面的商品目录功能。用的是treeview控件procedure TGoodsList.tv1Click(Sender: TObject);var curbh:string;s:TStringList;begintrycurbh:=copy(tv1.Selected.Text,0,pos('-',tv1.selected.text)-1);finallyend;s:=Tstringlist.Create; with tan_dm.dsp1 do begin close; commandtext:=''; if rb1.checked=true then commandtext:='select distinct goodsid from hmgoods a inner join 项目 b on a.hmid=b.id and rtrim(b.hmbh) like '''+curbh+'%'+'''' else commandtext:='select distinct goodsid from fggoods a inner join 分柜 b on a.fgid=b.id and rtrim(b.hmbh) like '''+curbh+'%'+''''; open; first; s.Clear; while not eof do begin s.Add(Fields[0].AsString); next; end; close; //以上是先读出分类表中包含的商品ID并写入s; end; {with dsp1} if s.Count<=0 then s.Add('0');if copy(tv1.selected.text,0,4)<>'全部' thenbegintan_dm.dsGoods.Filtered:=false;tan_dm.dsGoods.Filter:='id in ('+s.DelimitedText+')';//过滤tan_dm.dsGoods.Filtered:=True;end else begin tan_dm.dsGoods.Filtered:=false;end;end;以上为过滤代码。当一个分类下面有超过2500多个品种时,报就报错Access violation at address 4DAEA1BF in module 'midas.dll'.read of address 00000034.这是为什么。分类下面的品种没有超过2500多个时,能正常过滤,不会报错。
 

Similar threads

后退
顶部