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

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

Posted on 2001-08-17
5
947 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
ID: 6396717
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
ID: 6397011
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 70

Expert Comment

by:Éric Moreau
ID: 6397195
0
 
LVL 1

Author Comment

by:Balshe
ID: 6401572
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
ID: 6401574
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

828 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