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
Solved

Generating trees

Posted on 1998-09-17
1
165 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

792 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