Access2000 quick tutorial-1.8 define the relationship between tables

Source: Internet
Author: User
8. define the relationship between tables. After defining the primary key and corresponding tables, you can create a relational database for each table. Application and Management of relational databases, the Chinese Access2000 has a strong ability, which is not comparable to the Chinese VisualFoxPro6 and the Chinese Excel2000. To establish a relational database, you must first create

8. define the relationship between tables. After defining the primary key and corresponding tables, you can create a relational database for each table. Application and Management of relational databases, the Chinese Access2000 has a strong ability, which is not comparable to the Chinese Visual FoxPro 6 and the Chinese Excel 2000. To establish a relational database, you must first create

Note: Chinese Access 2000 cannot create or modify relationships between opened tables. Therefore, you must disable all opened tables, which is different from Chinese Visual FoxPro6.



Step 1. Press the F11 function key on the keyboard to switch the current operation window to the Database window.

Step 2. Click the link button in the "Database" toolbar. For details, see 9.


After that, if a relational table already exists in the current database, the "Link" dialog box shown in Figure 40 is displayed. If the current database does not define any relationships, the "show tables" dialog box is displayed automatically in Chinese Access 2000, allowing you to select the table to be joined, as shown in Figure 41.




9. Click this button.


0 select this command from the shortcut menu


If the table to be added is not listed in the "Link" dialog box, you need to enter the "display table" dialog box. To do this, right-click any part in the "Link" dialog box, select the "display table" command from the shortcut menu. Parameter 1. Next, you can select the table to be added in the "table" tab of the dialog box, and then click "add. The following operations will use the three data tables "employee and task", "customer and sales volume", and "customer and contract amount", all of which were created prior to this date, the input data record is also very simple, as shown in field 42, you can build your own.





1. Enter the "display table" dialog box.


2. Create relationships for the three tables


Note: The purpose of establishing relationships for several tables is to make them form a relational database, that is, to become a "related table ".

Step 3: Drag related fields from a table to related fields in another table.



To drag multiple fields, press Ctrl on the keyboard and click each field to be dragged. In most cases, Chinese Access 2000 requires that the primary key field in the table (displayed in bold) be dragged to a similar field named external key in other tables (usually with the same name ), the ID field in each table is displayed in section 42. Related fields do not need to have the same name, but they must have the same data type (only two exceptions) and contain the same type of content. In addition, when the matching fields are "Numbers", they must have the same "field size" attribute settings. Two exceptions for matching data types are:





3. Enter the "Edit link" dialog box.

1. The "automatic number" field matches the "Number" field set to the "long integer" data type.

2. The "automatic number" field matches the "Number" field set to the "synchronous copy ID" data type.

Step 4. In the "Edit relationship" dialog box shown in 3, check whether the field names displayed in the two columns are the same. To ensure correctness. You can change it here if necessary. You can also set link options if needed. Click "CREATE.





4. Result of the preceding operation

Next, you can follow these steps to create an association for each table. In this chapter, the primary key used is the ID field, so the operation result is shown in 44. In this illustration, the ID field in each table uses a line to connect with the same field of the other, which is the method of Access2000 Association. When the "Link" window is closed, a prompt is displayed asking if you want to save the layout configuration. Whether or not the configuration is saved, the created link is saved in the current database.


Note: To view all the relationships defined in the database, click "show all relationships" in the "Database" toolbar. If you only need to view the relationships defined in a table, click the table and then click the show direct link button in the "Database" toolbar. To change the table design, right-click the table and use the "Table Design" command in the shortcut menu.

Summary:

Access 2000, a Chinese language introduced in this Section. This software is very powerful in data processing and features its visualized operations. If you already have a clear understanding of database and table creation and application methods, and related concepts, you will not feel hard to learn here, the examples provided in this tutorial do not use many fields, and there are only a few rows of data records. You can easily create them. Next, this tutorial applies the indexes and relationships created by the application to Access 2000 in Chinese. You will see different operation methods than Visual FoxPro6 in Chinese, and their functions are similar.

Questions:

1. What are the operations for creating databases and tables in Chinese Access 2000?

2. What are the general "forms", "Windows", and "dialog boxes" used in this chapter? What are their respective features?

3. What is a "primary key "? Why use it?

4. How are the relationships between creating indexes and defining tables operated?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.