Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Generating trees

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
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 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…
Suggested Courses

597 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