Solved

Generating trees

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now