Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Related a record to another record in the same file ad-infinitum.

Status
Not open for further replies.

KirkJewell

Programmer
Oct 6, 2000
54
GB
Firsty I'm a Clarion virgin, so please be gentle with me (only 20+ hours of C5 use and gagging to get going)!!
BACKGROUND
I want to create a Parent_Child database (for task management). There is only one primary table (not including secondary tables attached to it. Each record has a unique ID number and a refence to its parent's ID. The parent's ID actually refers to the unique ID of another record in the same table (any record except itself).
I have managed to create a relation by using an ALIAS. (So what's your problem - I hear you ask!).
Ideally I would like to display these 'Tasks' in Tree form allowing the user to add Children to Parents until their heart's content.
In VB(Access) the relational tree (an ActiveX control) HAS to be built through code. It is not possible to attach a dataset to it dynamically. However you define a 'Node' which (except the very first) has to attach to another (existing) 'Node'.
QUESTION (finally!)
How do I create/build a data set of records for the relation tree control to display (I would rather not be limited to the 29 levels, but thats not the biggest issue).
AFTERWORD
I have no problem with building the dataset with code (I have always had to before). The only way I can see to solve this issue at present is to define (upto)29 Parent-Child Related ALIAS files in the dictionary or with code and fill them with a recursive procedure - which I am happy to do, but it seems somehow.....tacky and resource hungry.
Any help would be very gratefully appreciated
REGARDS
Kirk Jewell
Acqwell Systems (London) Ltd
kirkjewell@bizonline.co.uk
+44 020 8523 4233
 
bhushantikar@rediffmail.com

i think you should use a queue technique to solve you problem for which you will have write an embedded code and create you own levels thru coding which can be much faster and easier task to solve your problem.. try it and let me know

 
I guess this is the same question as the other thread and it looks like you have already found out about using Alias files to format the tree. Basically when you ask for a Tree format, a extra field called _Level is added. If you want to handcode the Queue and you want page-by-page loading, you have to take care of it yourself. If the dataset is small you could generate the whole queue and display it.

Queue:Browse:1 QUEUE
ORG:ID LIKE(ORG:ID)
ORG:Name LIKE(ORG:Name)
ORG:Name_Level LONG !Tree level <------
Mark BYTE
ViewPosition STRING(1024)
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top