CITY UNIVERSITY / Vysoká Škola Manažmentu

.:CS 416 - Database Management:.

 
Syllabus
Assignments Schedule Theory Practice Grades
           
PRACTICE
   
MS Access 1

1. Start Microsoft Access, choose Blank Database.

2. Save as the bsba/cs416/your section/your last name

3. A window with 7 tabs (options) appears. 1st choice is Tables – most basic part of this DBMS (using tables you can create forms, queries, etc.)

4. Click New – Design View.

5. Create a table with customers’ data (ID, First and Last name, Address, City, Year of Birth, photo – 7 elements of different type – some of them are textual data, some numbers, and a picture)

6. In the 1st field name write customerID; in the data type cell choose AutoNumber. We want the customer ID be unique identifier in our database (there cannot be two identical IDs), so we make it a primary key – click Edit – Primary Key (eventually right-click, choose primary key, or click the “key” button – 9th from the right). The DBMS will automatically generate this number for each entered record. In the “description” field write: Number automatically assigned to a new customer.

7. In the 2nd field write lastname (no spaces), the data type will be text. In the Field properties part, General section, change the Required option (3rd from the bottom) to Yes, as we want this to be a required entry. Also change the length – field size (1st option) to 30 (as probably there won’t be longer last names than that – we need to save the space in DB)

8. 3rd field – firstname, text, length 15 characters, required.

9. 4th – City – text, 25, required.

10. We want the address to appear before the city, right click the “city” row, choose insert row and write into the 4th row– Address (will contain street and street # - combination of text and numbers), data type will be text, leave field size 50, required.

11. 6th – year – number, field size = long integer, not required.

12. 7th – photo – OLE object, not required.

13. In the Description cells describe each element e.g. (year = customer’s year of birth).

14. Save the table, name it customers.

15. Open the table and insert 5 entries.

16. To insert a picture, click the data entry field, right-click, choose insert object, from the available menu choose bitmap image, ok. This will start MS Pain. Click Edit – Paste from, find the desired image and confirm your choice.

17. Create a data entry form for this table (user-friendly interface), make sure you have open Form Design and Toolbox toolbars (view, toolbars.)

18. Click the tab Form, choose New – Form Wizard and choose the table (from which to make a form) – customers.

19. Move all the elements in the Selected fields window (click the double arrow), click next

20. Choose columnar look of the DB form, and standard style.

21. Name the form customers and choose option modify the form’s design.

22. Choose view – form view (it’s how the form looks like, while design view serves for adjustments and modification)

23. You can browse individual entries with the arrows at in the bottom of the form (if you click the double-arrow, you get to the very last record in the form, if you click the arrow with asterisk, you get to the “new entry” row – so you can enter new data.

24. Enter new data.

25. Create other 2 tables –
a. Products -- will contain productID (AutoNumber, primary key), name, category, description (memo as it might contain more than 255 characters), price (data type = currency, format - Euro)
b. Orders – transactionID (data type = automatic number), date/time, customerID, productID, quantity (number, long integer).

- In both tables set the primary key, define field size (number of characters), describe individual fields, choose if the entry is required or not, and enter 2-3 records into each table. [In the Products table insert 2 categories (food, beverages) and 2 products for each category (e.g. brad, rice; milk, pop).
- Use form wizard to create 2 forms – Products and Orders.
In the form – there are so called labels (on the left), and text boxes (for entering the data) – in our case on the right. The text label serves as a description for the data entry field.

26. To make label/text box smaller/larger and format the form, open the form in the (View-) Design View to edit it. Click on the text-field/label, move the mouse over the little square until the arrow appears and simply drag it to make it smaller or larger.

27. Similarly, by dragging side/bottom part/border of the form, you can change the actual size of the whole form – header, body and footer. Try to enlarge the header area simply by dragging down the detail bar.

28. To move individual labels and text boxes click on the box you want to move – move a mouse over the field – if a hand appears – you’d be able to move both element – label and text box, if a pointing index finger appears, you could move just the field alone. Try to move first both (whole hand) and then the entry field to the very right.

29. To move all elements in the form at once, choose edit – select all, eventually hold the shift key and click all the fields, move the mouse over the elements and when the hand appears, move them to desired location.

30. In order to format the form and/or its individual elements, right-click, choose properties, eventually click View – Properties. A window with 5 tabs/options appear (all, format, data, event, other). To change the appearance of the form interface, click format.

31. To change the background color click in the Back Color row, click the button next to it, choose color, click ok