?
Solved

Generating trees

Posted on 1998-09-17
1
Medium Priority
?
168 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 150 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 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