Solved

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

Posted on 2001-08-17
5
952 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
[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
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
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.
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…

726 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