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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Document

Status
Not open for further replies.

MrM121

Programmer
Aug 21, 2003
83
GB
Hi everyone,

I'm considering creating a document library, which will be published onto a webpage, with links leading to where all the documents are stored on a shared Network Drive. I haven't quite decided whether to use Access or SQL for the databases index (it doesn't really matter, as I will then generate the XML document (when I figure out how to do it) occasionally, so it will not be a live database).

What I was wondering was if someone had any pointers for how to create a relational database for it. For example, say we have a table with, for example, Main Headings, and these Main Headings can have sub-Headings (more than one for each). That is easy enough to do (have two tables to do that), but say for example these sub-Headings can have sub-Headings of their own, which can also have sub-headings of their own, and so forth - just like a filing structure.

Does anyone have any ideas?
 
Do a keyword search for self join

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Sounds like you've just talked yourself into a simple recursive table structure. ( Much like you'd have in an Organisation chart - Fred is manager for Sally, Jane, Peter and Paul, Paul is manager for .. .. etc for as many levels as you need.


So you have a Heading table

tblHeading
HeadingId
HeadingRef Foreign key that points to HeadingId at the next level UP
HeadingText
OtherDataFields
etc..



If a record has HeadingRef = null then
It is a top level Heading
Else
It is a sub-Heading
count recurively through the levels to get the level count if you need it.
EndIf



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Cheers, so far these are great ideas, as the 2 ideas that I had were:

a) A table for each tier (no matter which heading it belongs to), and then create a table when there are no tables for that particular tier - seemed a bit far fetched though.

and

b) What you had suggested, but just wasn't sure about the logistics.

Cheers for all this.

There will be more to come on this topic, especially when it comes round to doing the XML stuff, lol.

Thanks,

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top