Solved

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

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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