THỨ TƯ,NGÀY 22 THÁNG 4, 2020

Access spends table matchmaking to decide how-to sign-up tables whenever you can make use of them into the a database target

Bởi Nguyễn Hoàng Phong

Cập nhật: 09/06/2022, 06:19

Access spends table matchmaking to decide how-to sign-up tables whenever you can make use of them into the a database target

As to why perform desk dating?

You may make desk relationship clearly using the Relationship window, or of the hauling an area from the Community List pane. There are several reasons why you should perform desk matchmaking in advance of you will be making almost every other databases stuff, like versions, requests and you can accounts.

To do business with suggestions regarding multiple dining table, you commonly must manage an inquiry that joins new dining tables. Brand new inquire functions by coordinating the values however trick realm of the first desk with a foreign key field during the the next dining table. Instance, to go back rows you to definitely identify all of orders per customers, you build an inquiry one meets the customers table towards the Commands dining table in line with the Consumer ID industry. About Relationship window, you could by hand indicate the newest sphere to participate. But, for those who curently have a love outlined amongst the tables, Access provides the default signup, according to the established table matchmaking. On top of that, by using among the ask wizards, Accessibility spends what it collects from the dining table relationships you have laid out to provide you that have told alternatives and to prepopulate assets configurations having suitable standard philosophy.

Once you build a form otherwise statement, Access spends everything it collects about dining table relationships your have already defined to present you having told choice and to prepopulate possessions configurations having suitable standard opinions.

Desk dating would be the base where you could potentially impose referential integrity to greatly help prevent orphan ideas in your databases. A keen orphan checklist try an archive that have a mention of various other list that will not occur – like, your order listing that sources a consumer number that doesn’t occur.

When you framework a databases, you separate your information to the dining tables, each one of which includes an initial key. You then include international secrets to associated tables you to site people number one points. This type of international trick-first secret pairings means the foundation getting desk dating and you can multi-table queries. It is necessary why these foreign key-no. 1 trick references stand synchronized. Referential stability, which is dependent on dining table relationship, helps ensure that recommendations sit synchronized.

Facts referential stability

Once you structure a databases, your separate the databases advice for the of many topic-oriented dining tables to minimize investigation redundancy. Then you bring Supply a means to promote the information back along with her by the position popular areas with the associated tables. Such as, to portray a one-to-of several relationship you take an important secret on “one” dining table and incorporate it as an additional job into the “many” dining table. To bring the information and knowledge straight back together with her, Accessibility requires the value on the “many” desk and you may seems within the corresponding really worth regarding the “one” table. Like this the values regarding “many” table site the associated viewpoints regarding “one” dining table.

Imagine you have a-one-to-of several relationships anywhere between Shippers and Commands and you also want to remove a Shipper. If for example the shipper you want to remove features commands from the Orders desk, people requests will end up “orphans” once you delete this new Shipper listing. The new commands often nevertheless incorporate a beneficial shipper ID, nevertheless ID will no longer become valid, just like the record so it references no further is present.

The intention of referential integrity is always to prevent orphans and keep sources inside sync to make certain that this hypothetical disease never happens.

Your impose referential stability by the helping they getting a table matchmaking. Shortly after implemented, Access rejects any operation that violates referential stability for this desk matchmaking. This means Supply have a tendency to reject both status one to alter the address out-of a resource, and deletions one to eliminate the target out of a resource. You are able you could have a perfectly good need changes the primary trick to own a great shipper that has sales on the Sales table. To possess for example circumstances, everything you want is actually for Use of immediately modify the the new affected rows included in an individual process. This way, Access means that this new improve is done in full in order for their databases isn’t remaining inside the a contradictory condition, with a few rows updated and some not. Thus Access aids the newest Cascade Revision Associated Areas choice. After you enforce referential stability and choose the new Cascade Modify Relevant Areas solution, and you then up-date a first key, Access immediately standing all of the fields that source the key trick.

Bình luận

Tôn trọng lẫn nhau, hãy giữ cuộc tranh luận một cách văn minh và không đi vượt quá chủ đề chính. Thoải mái được chỉ trích ý kiến nhưng không được chỉ trích cá nhân. Chúng tôi sẽ xóa bình luận nếu nó vi phạm Nguyên tắc cộng đồng của chúng tôi

Chưa có bình luận. Sao bạn không là người đầu tiên bình luận nhỉ?

SEARCH