Step by step exercise. Append queries


Objective.

 

Practice the procedures for Creating Append queries.

 

Exercise 1.

 

We will add the courses from the New courses table to the Courses table that we will provide in the TEACHERCLICK_CLASSES database of Exercises folder. For this you will first need to copy this database to the My exercises folder in the hard-drive.

1 Copy AULACLIC_CLASSES.mdb database from Exercises folder to My exercises folder.

2 Open the AULACLIC_CLASSES.mdb database from My exercises folder.

3 Position yourself in the Queries tab of the Database window if not already there.

4 Click on the Create query in design view option.

5 Double click on the New courses table. We always start by defining the data source, we are going to get the courses from the New courses table.

5 Click on the Add button.

6 Click on the Close button to close the dialogue box.

We already have the design window with the added table, we will now add the fields that we need (those that we want to update and those that we need to add in the search criteria, in our exercise we want to update all the courses and so we will not put a search criteria.

7 Double click on all the fields to include then in the grid.

8 Drop down the button on the toolbar and select the Append query... option.

9 Write the name of the table where we want to insert the courses to, Courses.

10 As the Courses table is found in the Classes.mdb database, check Another database: option and click Browse... a dialogue box will appear, look for the My Documents folder and double click on the classes.mdb name. The name of the database you have selected in the File name: box should appear.

11 Click on the OK button to return to the Design view window.

12 Observe how in the Append to: row Access has automatically put the name of the fields from the Courses table that have the same name).

13 Click on the Append To: row in Start column and select Start Date field.

14 Click on the Append To: row in Finish column and select Finish Date field.

15 Click on the Datasheet view button to check the data being inserted.

16 Click on the Design view to return to the design view.

17 Click on the run button to insert the records.

18 Close the query, naming it Add new courses.



Legal warning: Authorised on-line use only. It is not allowed the use of these courses in companies or private teaching centres.
© aulaClic. All rights reserved. Reproduction in any form whatsoever is prohibited. April-2006.