473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Enforce rules with code or database design?

A typical inventory management system would have people linked to items that
link to other items.

However in what I'm trying to do, PCs are one of the inventory items. One PC
can be linked to many monitors and harddisks etc, but only 1 motherboard.

How do I enforce this?

Not every item uses a motherboard, so I didn't put a 'Motherboard' field in
the 'Items' table. Do I create a 'Motherboards' table instead and use a
one-to-one relationship to link to 'Items' table?

If I want to ensure that a PC with AMD cpu can only be linked to a AMD
motherboard and not a Intel board, should I create another table that
contain a list of 'lawful' connections, and use that table as rowsource for
some combox/lisbox?
Nov 12 '05 #1
2 1292
Good question

I think??? you can get away with table of Items lets say
ItemID Autonumber Key
ItemDesc Text
Specific Yes/No ' Is this general purpose eg Printer, or
specific eg AMD
NumberLimited Yes/No 'Yes 11 to 1 eg AMD board & CPU, No PC & printer
GroupID

A table of Groups
GroupID
Group eg CPU, Printer, Disk

Then the link table of
ItemID1 Long Number
ItemID2 Long Number

Rules probably enforced by VB
ItemID1 <>ItemID2
If Item1 and Item2 both have Specific set to yes the check names (perhaps
the first few letters of the description are the same)
If Item1 and Item2 both have NumberLimited set to yes then cant have more
than 1 item per group

HTH

Phil
"noone" <no***@nowhere.com> wrote in message
news:br**********@mawar.singnet.com.sg...
A typical inventory management system would have people linked to items that link to other items.

However in what I'm trying to do, PCs are one of the inventory items. One PC can be linked to many monitors and harddisks etc, but only 1 motherboard.

How do I enforce this?

Not every item uses a motherboard, so I didn't put a 'Motherboard' field in the 'Items' table. Do I create a 'Motherboards' table instead and use a
one-to-one relationship to link to 'Items' table?

If I want to ensure that a PC with AMD cpu can only be linked to a AMD
motherboard and not a Intel board, should I create another table that
contain a list of 'lawful' connections, and use that table as rowsource for some combox/lisbox?

Nov 12 '05 #2
Thanks Phil, I think your suggestion will work.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:3f***********************@mercury.nildram.net ...
Good question

I think??? you can get away with table of Items lets say
ItemID Autonumber Key
ItemDesc Text
Specific Yes/No ' Is this general purpose eg Printer, or
specific eg AMD
NumberLimited Yes/No 'Yes 11 to 1 eg AMD board & CPU, No PC & printer GroupID

A table of Groups
GroupID
Group eg CPU, Printer, Disk

Then the link table of
ItemID1 Long Number
ItemID2 Long Number

Rules probably enforced by VB
ItemID1 <>ItemID2
If Item1 and Item2 both have Specific set to yes the check names (perhaps
the first few letters of the description are the same)
If Item1 and Item2 both have NumberLimited set to yes then cant have more
than 1 item per group

HTH

Phil
"noone" <no***@nowhere.com> wrote in message
news:br**********@mawar.singnet.com.sg...
A typical inventory management system would have people linked to items that
link to other items.

However in what I'm trying to do, PCs are one of the inventory items. One PC
can be linked to many monitors and harddisks etc, but only 1

motherboard.
How do I enforce this?

Not every item uses a motherboard, so I didn't put a 'Motherboard' field

in
the 'Items' table. Do I create a 'Motherboards' table instead and use a
one-to-one relationship to link to 'Items' table?

If I want to ensure that a PC with AMD cpu can only be linked to a AMD
motherboard and not a Intel board, should I create another table that
contain a list of 'lawful' connections, and use that table as rowsource

for
some combox/lisbox?


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: gino | last post by:
Dear all, My monitor was set to 1600x1200 so the fonts in IE is too small for me even when I set the "View->Text Size->Largest"... I don't have previlage to change the monitor resolution... ...
27
by: Stuart Gerchick | last post by:
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices by Herb Sutter, Andrei Alexandrescu is now a month or so away from release. What is people's opinion on this...is it going to be a...
9
by: obhayes | last post by:
Hi, I have two tables Table A and B, below with some dummy data... Table A (contains specific unique settings that can be requested) Id, SettingName 1, weight 2, length Table B (contains...
29
by: Ron Burd | last post by:
Hi, As my company is moving into C# they are enforcing the use of styling convention in the source code, such as methods naming conventions, newlines, etc. Does someone know of products that...
11
by: hazz | last post by:
before I start filling up the first page of perhaps many pages of code with if/then or switch:case buckets, I wanted to step back and see if there is a better way... I will have a table with up to...
1
by: Gaffar | last post by:
Hello Sir, i have created ms access database file by using ADOX. in which i have created 4 tables. 1 master table and 3 child tables. in the master table i have assigned primary key and in the...
1
by: Homer J. Simpson | last post by:
I've been toying with ASP.NET 2.0 for a few weeks now, and have only recently started looking at the login controls. The ASP.NET web site admin tool lets you create access/deny rules that apply...
3
by: jonny | last post by:
I have a python code that manages some parameters using some variable rules that may change from day to day. I'd like that the code will self-modify according to rules parsed from a xml file: ...
27
by: matt | last post by:
Hello group, I'm trying to become familiar with the information hiding design rules, and I have a lot (3) of questions for all you experts. AFAIK, a generic module has 2 files: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.