Rabu, 08 Juni 2011

Creating a database in Microsoft Access is relatively straightforward. This lesson demonstrates how to create a database.
  1. You may notice that, whenever you start Microsoft Access, you see the following screen. In this case, you can simply select "Blank Database".
    Creating a new database in Access - step 1a If you already have Access open, you can go to the "File" menu and click on "New Database":
    Creating a new database in Access - step 1
  2. Choose "Blank Database". (Skip this step if you already chose "Blank Database" at step one). You also have the ability to choose from a template, but we'll just use a blank database here:
    Creating a new database in Access - step 2
  3. Choose a location to save the database:
    Creating a new database in Access - step 3

Your New Database

Once you've completed the above tasks, you should see a blank database, like this:
Creating a new database in Access - step 4 We know this database is blank because it doesn't have any tables. If it did, you would see these tables in the middle pane of the table tab. Now that we have our blank database, we can start adding some tables.

Design View

"Design View" enables you to create your database tables and specify the columns and their data types etc. The following steps demonstrate how to switch to Design View and create a table.
  1. Ensuring you have your blank database open and you're on the following screen (with the "Tables" tab selected), click "New":
    Creating a database table in Access - step 1
  2. Select "Design View" and click "OK":
    Creating a database table in Access - step 2
  3. Fill out the details in the "Field Name" column and the "Data Type" column. Here, we are creating the column names and specifying the type of data that can be entered into them. Restricting the data type for each column is very important and helps maintain data integrity. For example, it can prevent us from accidentally entering an email address into a field for storing the current date. Other options for each column include restricting the length of data (under "Field Size"), setting a default value (this is used if someone leaves the field blank), specifying whether the data is required, and more. Leave these options with their default value for now.
    Creating a database table in Access - step 3
  4. Click the "Save" icon, enter the table name ("Individual"), and click "OK":
    Creating a database table in Access - step 4
  5. When prompted to set a primary key, click "Yes". (A primary key ensures that the data in this column is unique - no two values can be the same. This is important for when you need to select or reference data from this column):
    Creating a database table in Access - step 5

Datasheet View

You have now created a database table called "Individual". You can now switch between "Design View" and "Datasheet View" as you wish. Datasheet View allows you to see any data that has been entered into the table.
  1. From the "View" dropdown icon, click "Datasheet View" (this changes the view from Design View, to Datasheet View):
    Creating a database table in Access - step 6
  2. You should now see something like this:
    Creating a database table in Access - step 7
We have just created a database table. This table doesn't have any data yet, but we have created the columns that are required before any data is entered.

Tidak ada komentar:

Robotix My hobby projects Thursday, 21 Nove...