Hierarchical listings

S

Sam Churchill

I have need to show a list of areas indented hierarchically on an ASP web
page like the following example.

The World
Europe
United Kingdom
England
Wales
Scotland
Northern Ireland
France
Germany
The Americas
North America
State 1
State 2
South America
Columbia
...



The data is held in a database table which has 3 fields (areaID, area,
subAreaOf). The data from the above example would be as follows.

areaID area subAreaOf
1 The World
2 Europe 1
3 United Kingdom 2
4 England 3
5 Scotland 3
6 Wales 3
......You get the idea...

Any idea how to generate the indented listings as economically as possible
on the queries.

Thanks,

Sam
 
M

Manohar Kamath [MVP]

Sam,

While I don't have the exact code, you might want to look at some recursive
code. Perhaps a code on threaded discussions should help you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top