关于表的关联

jurgen_klinsi 2004-11-21 08:20:17
请问;现在两张表,我要求第一章表中某个字段改变第二张表中编号相同的那个相应字段自动改变,请问如何操作?
...全文
86 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuyann 2004-11-22
  • 打赏
  • 举报
回复
在ACCESS的关联双击表间的关联线然后,选择相应的操作类别

Define relationships between tables
Close any tables you have open. You can't create or modify relationships between open tables.


If you haven't already done so, switch to the Database window. You can press F11 to switch to the Database window from any other window.


Click Relationships on the toolbar.


If your database doesn't have any relationships defined, the Show Table dialog box will automatically be displayed. If you need to add the tables you want to relate and the Show Table dialog box isn't displayed, click Show Table on the toolbar. If the tables you want to relate are already displayed, skip to step 6.


Double-click the names of the tables you want to relate, and then close the Show Table dialog box.


Drag the field that you want to relate from one table to the related field in the other table.
To drag multiple fields, press the CTRL key and click each field before dragging them.

In most cases, you drag the primary key field (which is displayed in bold text) from one table to a similar field (often with the same name) called the foreign key in the other table. The related fields don't have to have the same names, but they must have the same data type (with two exceptions) and contain the same kind of information. In addition, when the matching fields are Number fields, they must have the same FieldSize property setting. The two exceptions to matching data types are that you can match an AutoNumber field with a Number field whose FieldSize property is set to Long Integer; and you can match an AutoNumber field with a Number field if both fields have their FieldSize property set to Replication ID.

The Edit Relationships dialog box is displayed. Check the field names displayed in the two columns to ensure they are correct. You can change them if necessary.
Set the relationship options if necessary. For information about a specific item in the Relationships dialog box, click the question mark button , and then click the item.

Click the Create button to create the relationship.


Repeat steps 5 through 8 for each pair of tables you want to relate.
When you close the Relationships window, Microsoft Access asks if you want to save the layout. Whether you save the layout or not, the relationships you create are saved in the database.

Notes

If you need to view all the relationships defined in the database, click Show All Relationships on the toolbar. To view only the relationships defined for a particular table, click the table, and then click Show Direct Relationships on the toolbar.


If you need to make a change to the design of a table, you can right-click the table you want to change, and then click Table Design.


You can create relationships using queries as well as tables. However, referential integrity isn't enforced with queries.


To create a relationship between a table and itself, add that table twice. This is useful in situations where you need to perform a lookup within the same table. For example, in the Employees table in the Northwind sample database, a relationship has been defined between the EmployeeID and ReportsTo fields, so that the ReportsTo field can display employee data from a matching EmployeeID.
changechange 2004-11-22
  • 打赏
  • 举报
回复
你必须为两个表建立关系,然后选择级联更新
如何手动创建关系?
http://access911.net/eg/swf/create_relation.htm
http://access911.net/eg/swf/create_relation.swf

7,714

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧