Difficulty: Moderately Easy
Things You’ll Need:
Relationship Integrity
Step1
Understand that referential integrity is a system of rules that Microsoft Access uses to ensure that relationship data is valid and that you cannot accidentally delete a record in one table if a matching record is present in a related table.
Step2
Know that you can enforce referential integrity when you create a relationship, or you can enforce it later by double-clicking on the relationship lines between the tables that you want to use. Click on Enforce Referential Integrity in the window that appears.
Step3
Realize that referential integrity cannot be set unless certain conditions are met.
Step4
Comprehend that you must observe certain rules once referential integrity is enforced.
Required Conditions for Setting Referential Integrity
Step1
Understand that you cannot set referential integrity unless the matching field from the primary table is a primary key or has a unique index.
Step2
Know that the related fields must have the same data type. There are two exceptions to this rule.
Step3
Realize that both tables must be present in the same Microsoft Access database. If they are linked, they must both be in Access format. You must open the database that contains these tables before you can set referential integrity.
Rules to Follow When Referential Integrity Is Enforced
Step1
Comprehend that when referential integrity is enforced, you will not be able to enter a value in the foreign key field of the related table unless that value exists in the primary key of the primary table. For example, in your CD database, you cannot assign a CD to an artist that doesn't exist in your Artist table. You could assign a null value to the CD however. This would indicate that the CD is assigned to no one.
Step2
Know that when referential integrity is enforced, you will not be able to delete a record from a table if there is a matching record in a related table. For example, you could not delete a record from your CD table if there is a matching record in your Genre table.
Step3
Know that you cannot change a primary key value in the primary table if that record has related records. For example, you cannot change the ID of a record in your CD database if the User table shows that this particular ID has been borrowed by a friend.
Comments
docsharp76 said
on 6/4/2008 Great blog with lots of useful information and excellent commentary! Thanks for sharing.
http://www.1-satellite-tv-facts.com/Direct-TV.html
http://www.1-satellite-tv-facts.com/Dish-Network.html
http://www.1-satellite-tv-facts.com/Satellite-Radio.html
http://www.1-satellite-tv-facts.com/T1-Internet-Service.html
http://www.1-satellite-tv-facts.com/Satellite-DSL.html
http://www.1-satellite-tv-facts.com/Satellite-Internet.html
http://www.1-satellite-tv-facts.com/VoIP.html
http://www.1-satellite-tv-facts.com/Phone-Systems.html
http://www.1-satellite-tv-facts.com/Affiliate-Programs.html