ITclub

العودة إلى Database
محاضرة 2

Getting Started with Microsoft Access

بداية العملي: إنشاء قاعدة بيانات، تصميم الجداول، وأنواع البيانات في Access.

ملخص المحاضرة

Lecture 2: Introduction to Microsoft Access & Table Creation

1. Getting Started with Access

Microsoft Access is a user-friendly DBMS used to create and manage relational databases on a desktop environment.

  • Creating a Database:
    • Open Access -> Select "Blank Desktop Database".
    • Crucial Step: You must name the file (e.g., CompanyDB.accdb) and select the file location before the database creates the workspace. This differs from Word or Excel where you save at the end.

2. The Access Interface

  • Navigation Pane: Located on the left, it displays all database objects (Tables, Queries, Forms, Reports).
  • Ribbon: Contains tabs like Home, Create, External Data, and Database Tools.

3. Creating Tables

Tables are the foundation of the database. There are two main views for handling tables:

  1. Datasheet View: Looks like an Excel spreadsheet. Used for entering and viewing raw data.
  2. Design View: Used to define the structure of the table (Field Names, Data Types, and Properties). This is where development happens.

4. Defining Data Types

When designing a table, every field must have a specific data type:

  • Short Text: Alphanumeric data (names, addresses), up to 255 characters.
  • Long Text (Memo): Large blocks of text.
  • Number: For data used in calculations (quantities, scores).
  • Currency: For monetary values (salary, price).
  • Date/Time: For dates (birthdate, order date).
  • AutoNumber: A unique number generated automatically by Access (often used for Primary Keys).
  • Yes/No: Boolean data (True/False).

5. Practical Steps to Create a Table

  1. Go to the Create tab -> Click Table Design.
  2. Enter Field Names (e.g., Employee_ID, Name, Address).
  3. Select the Data Type for each field.
  4. Set Primary Key: Right-click the unique field (e.g., Employee_ID) and select "Primary Key". A key icon will appear.
  5. Save: Click the Save icon or Ctrl+S, give the table a name (e.g., Employees), and click OK.