Print Page | Close Window

Advice needed

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7662
Printed Date: 01 April 2026 at 12:59am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Advice needed
Posted By: ngaisteve1
Subject: Advice needed
Date Posted: 27 November 2003 at 8:16pm

I just want to seek some advice before I go further.

The scenario is like that. I have 2 tables.

1. Company
2. Product Category

One company can have one or more product category.

I have a form for product category. This form is just to add and maintain one field which is product category.

I have a form for company. This form is to key in company details like company name, address, phone etc and there is a button to save and go to next form. Next form is retrieve from Product Category table. And next to every product category there is a checkbox (view attachment - http://www.htmlforums.com/attachment.php?s=&postid=201829 - http://www.htmlforums.com/attachment.php?s=&postid=20182 9 ). My existing company got a field named productcategory. And when I save it, the productcategory field in Company table will have an appended value. Eg, 1,2,5,6 (assuming all these number is product category id).

My question is if let's say I ammend the product category either delete or modify it, this means there will no longer synchronize with productcategory field in company table.

So, I wonder in this situation what's the best solution. One company can have one or more product category and this product category is not fix.




Replies:
Posted By: ngaisteve1
Date Posted: 27 November 2003 at 9:34pm

It's ok, I think I got it. I just need to create another table and this table I name is Cust_ProductCat. In this table there will be CustomerID and ProductCatID and when I edit or delete my product category, two tables (ProductCat and Cus_ProductCat) will make changes together.

If anyone lost it or can't understand, just ignore my post. Perhaps I just want to document a little things here.



Posted By: ljamal
Date Posted: 27 November 2003 at 9:37pm
Give companies a unique ID and

1) add a CompanyID field to the ProductCategory table, so every ProductCategory is linked to a Company

OR

2) Create another table that stores the CompanyID with a ProductCategoryID to associate ProductCategories with Copanies.

Use 1 if each product category is associated with only one company. Use 2 if a product category can be associated with more than one company.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: ngaisteve1
Date Posted: 27 November 2003 at 11:10pm
Thanks, IJamal. I thought no one can understand that but you did. My reply to self is something like your second method.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net