Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

representing hierarchical data in Access

Status
Not open for further replies.

dj982020

Programmer
Jun 11, 2004
27
US
I am looking for some good online resources/references for representing hierarchical data or trees in Microsoft Access. Please Help!

Thanks in advance,
DJ
 
Does this work with queries or forms only?

Thanks,
DJ
 
use a LITTLE initative. see the ubiquitous {f1} (aka H E L P)




MichaelRed


 
Thanks for your help up until this point Michael, but if you don't want to help me any further, you don't have to (aka you can choose not to reply).

Of course I had looked into TreeView before replying. My question was more like, "I thought this control worked for displaying data." I have read up on TreeView and all I can find is how to pass data to this control and display data in a form using this control. I'm using Access 2003 and cannot find any info about it in Help.

I originally asked for online resources dealing with representing hierarchical data in Access. I would like to write queries/code to take my data from a flat table to hierarchical so that I can run queries on the hierarchical form.

Thanks in advance,
DJ
 
Can you give an example of the kind of hierarchy that you want to create. Also, What do you want to see with a typical query on this hierarchial data.
 
dj982020,

In Access VBA, you can setup a class module (super class). At the module level of super class module, you can setup pointers that point to other "sub" class modules which fill with the desired data. Repeat the process to get to as many levels as you like. It might sounds complicated, but is quite easily accomplished.

Once you have your data in the momory domain, you can manipulate them until your heart's contend.
 
Repersentation <> develpoment (of hierarchical data). Your (original request) requested help with the representation. TreeView is a good canidate fot the representation. I assume that b y representation you mean (or meant) VISUAL representation. not logical representation. Forms / Reports are appropiate to the Visual representation. Queries are (perhaps) appropiate to the logical representation. Sorry for being quite so cryptic, thought (and still think) my response was 'in-line' with your request.





MichaelRed


 
I may have a parent/child table that looks like this:

ID NAME CHILD
1 Arnold 4
1 Arnold 5
2 Karen 3
3 Rick NULL
4 Tommy 6
5 Nicole NULL
6 Sam NULL

The resulting tree would look like:
+ Arnold
+ Tommy
- Sam
- Nicole
+Karen
- Rick

In another table, I have the dollar amount that each has contributed to a fund:

ID AMOUNT
1 $10
2 $25
3 $5
4 $20
5 $30
6 $5

I would like to perform queries on this data. One thing that I may want to know is how much a particular subset of the family has contributed.
EX. How much has Arnold's family (all those under him) contributed? (i.e. Arnold + Tommy + Sam + Nicole = $65)
How much has Tommy's family contributed? (i.e. Tommy + Sam = $25)
 
I assume the data volume is not too large - maybe a few thousand records. If so, the OLEDB MSDATASHAPE provider will represent data in a hierarchial recordset. By using this provider you could represent the data you show in a hierarchy in an ADO recordset. Once the recordset was built, then the Filter method of ADO can be used to query the recordset.

Rob MacDonald in the book, Serious ADO, has a chapter on setting up hierarchial recordsets.
 
Forget it, its not worth the efforts. Spend your time and energy with ADO.NET instead. It much more powerful.
 
Clipper2000 said:
" ... Spend your time and energy with ADO.NET ... "


And ... of course ... you are willing to contribute the necessary "resources (Read $$$) to facillitate this? Noting that there may also be training needs for however many?





MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top