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!

Relationship Help 1

Status
Not open for further replies.

Parmb

Technical User
Dec 17, 2001
89
GB
I'm creating a dbase to log IT equipment. however, i want seperate table for items such as,
Monitor,
CD Drive,
etc

(Comp No, type, monitor no, etc)
(Monitor no, manufacturer, etc)

because we may carry spares which are not assigned to any particualar machine. So it's a simple 1:1 relasionship. However, in certain instances the user may not haev time to incude att the detail, hence leave the field blank.

Due to the 1:1 this is not possible, unless i do not force referencial integrity. But i need this 4 when i del a PC i want it's assosiated devices also deleted.

Anyone Help pls
 
Let's see if I understand your situation. You have:
(1) computers, and
(2) related peripherals.
In some cases the peripherals are assigned / attached to a computer, in other cases the peripherals are spare parts (not assigned to a computer).

When you delete a computer, you want to delete it's assigned peripherals.

My suggestion is to have just 2 tables, but this will work with more than that:
[ul]
[li]tblComputers - just for the computers
[li]tblDevices - just for the peripheral devices
[/ul]
The tblDevices table will have a foreign key referencing the computer it is assigned to (if any).
[ul]
[li]The join is tblComputers 1->many tblDevices
[li]Specify Enforce Referential Integrity
[li]Specify Cascade Delete Related Fields
[/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top