飘摇客:进来接分(谢谢你的TREEVIEW例子)(200分)

  • 主题发起人 主题发起人 xuming
  • 开始时间 开始时间
X

xuming

Unregistered / Unconfirmed
GUEST, unregistred user!
飘摇客:进来接分(谢谢你的TREEVIEW例子)
 
xuming, 可以发一份给我吗,我也可以给你加分,多谢
 
to pjxy, 开个新贴呀。
procedure TForm1.CreateSubTree(StrProd_No,StrParent: string; Node: TTreeNode = nil);
var
mLocalName: string;
TreeNode: TTreeNode;
Ads_Tmp: TADODataSet;
begin

ADS_Tmp := TADODataSet.Create(application);
ADS_Tmp.Connection := ADOConn;
with ADS_Tmp do
begin
Close;
CommandText := 'Select * from Tbom Where Parent ='+#39+StrParent+#39
+' and prod_no='+#39+strProd_no+#39;
Open;
First;
while not Eof do
begin
mLocalName := FieldbyName('item_no').Asstring;
TreeNode := TV_BOM.Items.AddChild(Node, FieldByName('item_no').AsString);
CreateSubTree(StrProd_no,mLocalName, TreeNode);
Next;
end;
end;
end;


 
后退
顶部