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

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

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
808
SUNSTONE的Delphi笔记
S
回复
10
查看
398
唐朝笨蛋
顶部