Home All Groups Group Topic Archive Search About

Generating Trees for Data

Author
24 May 2005 10:36 AM
John Ortt
Hi there,

I am hoping for a little help with a tool I am creating for generating Data
Trees.

I have a table which documents the update process for an access database in
the following form:

Master                Slave
--------------------------------------------------------------
None                  Autoexec
Autoexec            DeleteOldData
DeleteOldData    DeleteTable1
DeleteOldData    DeleteTable2
Autoexec            AddNewData
AddNewData     AddTable1
AddNewData     AddTable2


The Master/Slave relationship determines the shape of the tree.
For the example above it would look something like:

Autoexec    DeleteOldData    DeleteTable1
                                            DeleteTable2
                  AddNewData      AddTable1
                                            AddTable2

What I can't figure out is how to generate the tree...

Would I have to stipulate a starting position such as the "Autoexec" or is
there a way to get the program to work it out?

Any help or recomendations are greatly appreciated.

Thanks in advance,

John

Author
24 May 2005 10:56 AM
John Ortt
If anybody has any useful website pointers I would also be very grateful...

Tried a Google search for "Visual Basic" "Data Flow" and "Trees" but it all
seemed to be about dreating data flows for the VB Code rather than using the
code to produce the flow for something else...

"John Ortt" <JohnOrtt@Idontwantspamsonoreturnaddress.com> wrote in message
news:4293017d$1_1@glkas0286.greenlnk.net...

<snip>
Author
24 May 2005 11:02 AM
John Ortt
I've also just thought of a way of beginning the code..

If I look for the entry where the Master="None" and then assign the slave as
the first master.

I then increment the columns by one and loop through the code looking for
all records which have the relevant master and write the slave name in the
next column....and so on....

I think I am getting somewhere...If anyone has any better ideas please let
me know before I spend days trying to code this (as my coding knowledge is
basic at best).

Thanks


Show quoteHide quote
> Master                Slave
> --------------------------------------------------------------
> None                  Autoexec
> Autoexec            DeleteOldData
> DeleteOldData    DeleteTable1
> DeleteOldData    DeleteTable2
> Autoexec            AddNewData
> AddNewData     AddTable1
> AddNewData     AddTable2
>
Author
24 May 2005 12:13 PM
Jim Mack
John Ortt wrote:
Show quoteHide quote
> Hi there,
>
> I am hoping for a little help with a tool I am creating for
> generating Data Trees.
>
> I have a table which documents the update process for an access
> database in the following form:
>
> Master                Slave
> --------------------------------------------------------------
> None                  Autoexec
> Autoexec            DeleteOldData
> DeleteOldData    DeleteTable1
> DeleteOldData    DeleteTable2
> Autoexec            AddNewData
> AddNewData     AddTable1
> AddNewData     AddTable2
>
>
> The Master/Slave relationship determines the shape of the tree.
> For the example above it would look something like:
>
> Autoexec    DeleteOldData    DeleteTable1
>                                             DeleteTable2
>                   AddNewData      AddTable1
>                                             AddTable2
>
> What I can't figure out is how to generate the tree...

I must be missing something, so forgive me for asking the most obvious question: have you looked at the TreeView control?  What doesn't that do that you need?

--

    Jim Mack
    MicroDexterity Inc
    www.microdexterity.com
Author
24 May 2005 1:43 PM
John Ortt
I must be missing something, so forgive me for asking the most obvious
question: have you looked at the TreeView control?  What doesn't that do
that you need?

?! - What TreeView control?...  As I said I am an absolute noobie at VB.
All I have learned is through macros in Excel and Access which I have then
converted to VB (and some experimenting of my own with looping etc).

I'll have a google for TreeView and let you know if I'm having problems.

Thanks for the pointer :)



--

    Jim Mack
    MicroDexterity Inc
    www.microdexterity.com
Author
24 May 2005 1:55 PM
John Ortt
Wow!!!

Just goes to show how you sometimes can't see the wood for the trees :)

The TreeView command looks perfect, I have just looked at a page which is
intended to be a tutorial but even the example data is in almost the same
format as my own...
http://people.revoledu.com/kardi/tutorial/VB/lesson06/Treeview.htm

Thanks Jim, I think I should be able to progress on my own now :)


Show quoteHide quote
"John Ortt" <JohnOrtt@Idontwantspamsonoreturnaddress.com> wrote in message
news:42932d69$1_1@glkas0286.greenlnk.net...
>
> I must be missing something, so forgive me for asking the most obvious
> question: have you looked at the TreeView control?  What doesn't that do
> that you need?
>
> ?! - What TreeView control?...  As I said I am an absolute noobie at VB.
> All I have learned is through macros in Excel and Access which I have then
> converted to VB (and some experimenting of my own with looping etc).
>
> I'll have a google for TreeView and let you know if I'm having problems.
>
> Thanks for the pointer :)
>
>
>
> --
>
>     Jim Mack
>     MicroDexterity Inc
>     www.microdexterity.com
>
>
Author
24 May 2005 4:07 PM
Jeff Johnson [MVP: VB]
"John Ortt" <JohnOrtt@Idontwantspamsonoreturnaddress.com> wrote in message
news:42932d69$1_1@glkas0286.greenlnk.net...

> ?! - What TreeView control?...  As I said I am an absolute noobie at VB.

So are you also new to Windows itself or have you just never used Windows
Explorer before? It's the poster child for the tree view control....
Author
24 May 2005 4:57 PM
Bob Butler
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:usX9uqHYFHA.2508@TK2MSFTNGP15.phx.gbl
> "John Ortt" <JohnOrtt@Idontwantspamsonoreturnaddress.com> wrote in
> message news:42932d69$1_1@glkas0286.greenlnk.net...
>
>> ?! - What TreeView control?...  As I said I am an absolute noobie at
>> VB.
>
> So are you also new to Windows itself or have you just never used
> Windows Explorer before? It's the poster child for the tree view
> control....

to be fair it's not like anybody should automatically know that there is a
control available in VB that looks like the left-hand part of Explorer.
It's not in the standard toolbox and could be easily overlooked in the
common controls.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
24 May 2005 5:34 PM
Jeff Johnson [MVP: VB]
Show quote Hide quote
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:OXQQ%23GIYFHA.3572@TK2MSFTNGP12.phx.gbl...

>>> ?! - What TreeView control?...  As I said I am an absolute noobie at
>>> VB.
>>
>> So are you also new to Windows itself or have you just never used
>> Windows Explorer before? It's the poster child for the tree view
>> control....
>
> to be fair it's not like anybody should automatically know that there is a
> control available in VB that looks like the left-hand part of Explorer.
> It's not in the standard toolbox and could be easily overlooked in the
> common controls.

I can grant that it's not easy to find in the IDE, but my general point is
that any programmer should be aware of standard controls, which the list
view, tree view, etc. have become since the introduction of Windows 95
almost 10 years ago. I doubt many people decide "I want to become a
mechanic" and then open up a car's hood and say "what's all this stuff?"

(I know, I know, VB's ease-of-use tends to attract more entry-level folks
than C. Doesn't mean I have to like it.)
Author
24 May 2005 7:14 PM
Bob Butler
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:%23xIhfbIYFHA.1148@tk2msftngp13.phx.gbl
> I can grant that it's not easy to find in the IDE, but my general
> point is that any programmer should be aware of standard controls,

If the OP had said "I'm new to VB, where's the tree view control" then I'd
assume he was not new to windows development.  The impression I got from the
OP was that he was new to coding in general (perhaps because the use of
"noobie" makes me think "l33t" and probably very young).

> which the list view, tree view, etc. have become since the
> introduction of Windows 95 almost 10 years ago. I doubt many people
> decide "I want to become a mechanic" and then open up a car's hood
> and say "what's all this stuff?"

That's pretty much the way I learn best.  Jump right in and try things!

> (I know, I know, VB's ease-of-use tends to attract more entry-level
> folks than C. Doesn't mean I have to like it.)

Strange, since that's what I always liked best about VB.  It was open and
inviting to the newbie and still powerful and challenging for more
experienced developers.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
25 May 2005 10:36 AM
John Ortt
Sorry if I offended Jeff.  As Bob correctly guessed I am not a programmer by
training, I am actually an Aerospace Engineer.

It just happens that for the last two years my projects have involved fairly
heavy use of Microsoft Access and I have gradually come to find some things
easier to do in VB than the standard Access Macros and Queries (despite a
few teething troubles and very limitted knowledge).

I am actually 28 years old, despite the 'l33t' speak... but I blame too much
online gaming...
I have been using computers since a very early age due to my father being in
the industry but I am only just beginning to realise that VB has the
capability to do just about everything within windows (provided you know
how).  For this reason I had no idea that the Windows Explorer Tree format
was a standard piece of code which could be applied to anything.....but I'm
glad I know now.

I often find it far easier just to ask the good folks on the ng's when I
have a problem rather than spend fruitless time trying to solve it entirely
on my own.  Sometimes you get a complete solution (such as in this case with
the TreeView command) and other times it will just be a pointer in the right
direction.  Regardless it allows for a far steeper learning curve than a
solo endeavour would.

Please bear with the less experienced coders amongst us Jeff.
Sometimes the stupid questions just need an equally stupid answer.

All the best and thanks for the help guys,

John