Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 31st, 2006, 05:39 AM
Registered User
Join Date: Jun 2004
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unlimited categories


I'm trying to think of the best way to have a database of items which would have unlimited sub categories, i.e. Main category of Cars then sub category of Manufacturer a sub of that say Parts and so on.

Do you have any ideas on how this could be done as i have only had experience of having a set number of sub categories in seperate tables and i know this isn't the correct way of doing it?

Is it possible to have all the categories and subcategories listed in the same table and linked somehow?

Sorry if i have worded the question strangely but i can't get my head around how to solve this problem.



Reply With Quote
  #2 (permalink)  
Old August 31st, 2006, 06:15 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

You would do this:

ManufacturerID - PK
ManufacturerName - text

CarID - PK
CarName - text
ManufacturerID - FK to tblManufacturer

PartID - PK
PartName - text
PartDescription - text

Then create a junction table to join parts to cars:

JunctionID - PK
CarID - FK to tblCar
PartID - FK to tblPart

This last table is how yu have all cars and their parts listed together in the same table and linked.

Does this help?

Reply With Quote
  #3 (permalink)  
Old August 31st, 2006, 07:21 AM
Registered User
Join Date: Jun 2004
Location: , , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for the reply.

I understand what you've said but it's not quite what i'm trying to do.

I'm looking to make a website which lists lots of categories with lots of levels of subcategories which can be added/updated/deleted all the time and i want my database, which i'm playing about with in Access before i decide anything properly, to be able to cope with any amount of subcategories without having to create any more tables as there is potential for alot of categories and other other categories below those.

I hope i tried to clear up to you what i'm trying to do.

Thanks again for your help


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multilevel unlimited subcategory ? atul PHP Databases 0 September 22nd, 2007 12:37 AM
Deleting Categories spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 July 19th, 2006 03:07 AM
Unlimited scrolling dartcoach VB How-To 3 January 19th, 2006 12:15 AM
cin and unlimited data set size phenix151 C++ Programming 4 October 13th, 2003 09:21 AM
Get unlimited input from user WO using sentinel # frank_jarle J2EE 4 July 9th, 2003 03:42 AM

All times are GMT -4. The time now is 10:44 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.