猪
猪面
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟我在使用treeview时,用item做query的搜索条件,如多次点击treeview(激活QUERY)
出现TOO MANY TABLE的错误,估计是内存控制的问题。望高手指点。100分不够可再加,
先到先得。
procedure TForm110.TreeView1Click(Sender: TObject);
begin
edit1.Text:=treeview1.Selected.Text;
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
if treeview1.Selected.Level>0 then
edit2.Text:=treeview1.Selected.Parent.Text;
if treeview1.Selected.Level>1 then
edit3.Text:=treeview1.Selected.Parent.Parent.Text;
if treeview1.Selected.Level>2 then
edit4.Text:=treeview1.Selected.Parent.Parent.Parent.Text;
edit5.Text:=copy(edit4.Text,1,3)+copy(edit3.Text,1,3)+
copy(edit2.Text,1,3)+
copy(edit1.Text,1,3);
edit6.Text:=copy(edit4.Text,5,35)+copy(edit3.Text,5,35)+
copy(edit2.Text,5,35)+
copy(edit1.Text,5,35);
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('select * from dwy where dwbm='+''''+edit5.Text+'''');
query1.ExecSQL;
query1.Open;
edit7.Text:=copy(edit5.Text,0,length(edit5.Text)-3);
edit8.Text:=copy(edit6.Text,0,length(edit6.Text)-length(edit1.Text)+4)
//edit5 是查询值
//能运行
end;
出现TOO MANY TABLE的错误,估计是内存控制的问题。望高手指点。100分不够可再加,
先到先得。
procedure TForm110.TreeView1Click(Sender: TObject);
begin
edit1.Text:=treeview1.Selected.Text;
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
if treeview1.Selected.Level>0 then
edit2.Text:=treeview1.Selected.Parent.Text;
if treeview1.Selected.Level>1 then
edit3.Text:=treeview1.Selected.Parent.Parent.Text;
if treeview1.Selected.Level>2 then
edit4.Text:=treeview1.Selected.Parent.Parent.Parent.Text;
edit5.Text:=copy(edit4.Text,1,3)+copy(edit3.Text,1,3)+
copy(edit2.Text,1,3)+
copy(edit1.Text,1,3);
edit6.Text:=copy(edit4.Text,5,35)+copy(edit3.Text,5,35)+
copy(edit2.Text,5,35)+
copy(edit1.Text,5,35);
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('select * from dwy where dwbm='+''''+edit5.Text+'''');
query1.ExecSQL;
query1.Open;
edit7.Text:=copy(edit5.Text,0,length(edit5.Text)-3);
edit8.Text:=copy(edit6.Text,0,length(edit6.Text)-length(edit1.Text)+4)
//edit5 是查询值
//能运行
end;