Task Description: The purpose of this article is to create a personal library management system (which can contain electronic books such as music CDs and data CDs) through access to help us manage every book. This database can record the basic information of each book, can be added or deleted at any time book records, but also in accordance with different conditions to quickly find a variety of personal library information. If the students, friends can establish such a database, the database merged, as if it is a small library, through the query can see if the book you need someone to buy, if any, you can borrow, do not have to repeat the investment.
Note: This example uses Access version 2003, and the other versions operate in a similar sequence.
Build a "warehouse" for the data
The first thing to do is to create an empty "warehouse" (database) before loading data into it.
First step: Start Access 2003, click the menu command file → new (or click the First New button on the toolbar), and click the empty database item in the new file pane on the right.
Step two: Set the filename and save the path in the new dialog box that opens, this example is named "Personal book Management," and then click the Create button (see Figure 1), and a new database is created.
Planning and storing data with "tables"
The house has been built and need to be decorated, to achieve better living effect, the database is the same, the building also have to plan well, in order to save different types of data. In Access, "table" is the core of the planning database, its main role is to save all the data according to a certain structure, other such as query, report and other operations need to be completed on this basis.
First step: Plan the table structure first. There are a lot of book information, this example is just a demo, so this example creates a basic information datasheet set only ordinal, title, author, publisher, purchase date, pricing, book category, Media and content introduction, and so on several fields.
Step two: As shown in Figure 2, click the Table button under Objects on the left side of the database main window, then double-click the "CREATE table with designer" entry on the right to open the Design view window, enter the field name in the cell for field name, click the data type cell to the right of it, and set a type for each field from the Drop-down list. In this case, the serial number is selected "AutoNumber", the purchase date is "date/Time", the price is selected "Currency", the content is selected "notes", and the other is "text". You can make specific settings for the data type in the field properties below the window. For example, the default length of the text data type is 50 characters, which is not enough when you encounter a long title, so you can change "field size" to 255 in its regular items, and 20 characters, like the author name, must be enough.
Step three: Once all the fields and data types are set up, the datasheet framework is complete. Access recommends that you set a primary key field for each datasheet so that you can define relationships with other tables in the database. Use the mouse to click in the ordinal cell, and then click the key icon on the toolbar to set this field as the primary key. Press Ctrl+s shortcut to save, the first time you save the datasheet will pop up a Save dialog box, enter the data table name (This example is "book basic Information") after the determination can be.