I am using Visual Basic 6 as front end and Sql server as a Back end, and Ado 2.5.

In my table there are 2 columns one is a Parent and second is a child. Suppose partendID 1 is there in parent col it will appear multiple times in parent col for it’s all child entries. Then that parentID 1 will be prensent in child col also because it’s a child of some other parentId. I have now TopMost hierarchy of the recordset. Now in a loop I have to find the children of all the branches of the Tree. I am having great difficulty in doing this. I would greatly appreciate your help. Once I get all the records in this hierarchy I have to write them in a word file in a index format. And referencing on which page details of that record will appear.

Top 1---------------
A( Top1’s Child 1)------------------
A1 ( A’s child1)
A2 (A1’s Child1)
B2 ( A1’s Child 2)
B1 ( A’s Child 2)
A2 (B1’s Child1)
B2 ( B1’s Child 2)
B( Top1’s Child 2)
And So on -----
Top 2------------------------

And so on -----
Top3---------------------

And so on-------------------

I have to show all these records in this format I have the values for the Top 1,2,3 and ---all and now with these values I have to find the values for each and every branches until it’s end node in loop and write them to wordfile.
Any help is appreciated.

Thanks.
Anagha