Solved

Representing(Storing) Tree Structure In Access DataBase +Tree Structure SourceCode In Vb

Posted on 2001-08-17
5
931 Views
Last Modified: 2008-03-17
What I Need Is How to represent a tree structure in Access database , how should i build the database and tables,or if you can give me the source code for Tree structure using Vb Code .
Thank You Very Much

0
Comment
Question by:Balshe
5 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
To represent a tree structure is actually quite simple, you need one table:

NodeID
ParentID
Description

This will allow you to identify each node uniquely and also the parent node of each item. You can easily read this table and create a treeview to display this information and vice versa write the contents of a treeview to a table with this structure.
0
 
LVL 3

Accepted Solution

by:
RodStephens earned 200 total points
Comment Utility
Tim's answer is good. A more space-intensive structure uses a separate link table. The Nodes table has fields:

    NodeId
    Description

The Links table has fields:

    ParentId
    ChildId

The main advantage to this version is you can build other, non-tree structures.

My book "Ready-to-Run Visual Basic Algorithms" has a lot to say about trees and other dynamic data structures. For more information, go to:

    http://www.vb-helper.com/vba.htm
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 
LVL 1

Author Comment

by:Balshe
Comment Utility
DEAR SIR
Mr. Rod Stephens
Thank you for your answer

As you know I've accepted your answer

I need to ask you about your book "Visual Basic Graphics Programming"
I bought your book 2 years ago
 I liked it very much, and enjoyed the book until chapter 6

Where in every form_load you but the following

 
  If Not GetDeviceCaps(hdc, RASTERCAPS) And RC_PALETTE Then
        Beep
        MsgBox "This monitor does not support palettes.", _
            vbCritical
        End
    End If

What I get after reaching the first Line is Runtime error 6 "overflow"
Though I have tried the same code on many computers with different VGA Cards
And Different Monitors
What is wrong?
And how should I solve this problem.

Sorry for using Experts-Exchange but it's the only way for contacting you since I couldn't find your email on any other Book or Site

Thank you very
I hope you keep writing in the same way
0
 
LVL 1

Author Comment

by:Balshe
Comment Utility
DEAR SIR
Mr. Rod Stephens
Thank you for your answer

As you know I've accepted your answer

I need to ask you about your book "Visual Basic Graphics Programming"
I bought your book 2 years ago
 I liked it very much, and enjoyed the book until chapter 6

Where in every form_load you but the following

 
  If Not GetDeviceCaps(hdc, RASTERCAPS) And RC_PALETTE Then
        Beep
        MsgBox "This monitor does not support palettes.", _
            vbCritical
        End
    End If

What I get after reaching the first Line is Runtime error 6 "overflow"
Though I have tried the same code on many computers with different VGA Cards
And Different Monitors
What is wrong?
And how should I solve this problem.

Sorry for using Experts-Exchange but it's the only way for contacting you since I couldn't find your email on any other Book or Site

Thank you very
I hope you keep writing in the same way
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

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

15 Experts available now in Live!

Get 1:1 Help Now