Solved

Generating trees

Posted on 1998-09-17
1
167 Views
Last Modified: 2010-04-30
How do I generate quick tree structure with data from a Foxpro table??  The table has more than 1500 records.
0
Comment
Question by:Minna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Bolleke earned 50 total points
ID: 1435463
It all depends on the datastructure in your table. What you need in a treestructure-table are a unique ID for each record and a Parent ID for each record wich is 0 for the root records.

Lets take an example DB-structure:

Table:MyDB
MyDB_ID       as Integer (autonumber)
MyDB_ParentID as Integer

Some example data:
ID       ParentID
1        0               (root node 1)
2        1               (child of node 1)
3        1               (child of node 1)
4        3               (child of node 3)

So your tree will look like:
*
** node-1
   *
   ** node-2
   *
   ** node-3
      *
      ** node-4

The control you use in VB for this type of things if the treeview control. You draw the control on your form, set the properties and then add nodes straight from your database. The trick here is: you can set a key with each node, use "K" & MyRecordset("MyDB_ID")
****************************************************************
    You can't give the node-key a numeric value, that's what the
    "K" is for.
****************************************************************

I hope this is what you needed, because your question is quite vague. If you need to make a treestructure on paper I've got some tips and tricks as well, I just finished a set of functions who do just that.

Let me know if I can be of any assistance!

Didier
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question