Microsoft Access
Recordsets exercise
Harder than average exercise

This Microsoft Access RECORDSETS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ACCESS VISUAL BASIC course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Combining two tables using recordset code

A full answer to this exercise is provided as part of the training course!

1) Download the files needed to start this exercise: exercise-450.zip (and click here if you experience any problems unzipping this file after downloading it).
2) The database contains the following tables:
  • The Sales table contains details of each transaction, but does not include the price paid
  • The PriceHistory table contains details for each product of the price history (for example, for Battery-powered Tony Blair toys the price was £5.00 between 1st and 31st of January 2005).
3) Create a procedure (or a suite of procedures!) which works through all the sales records, extracting the correct price for each given the transaction date and then creating a new corresponding record in the ProductPrice table.
Training exercise hint To select records from a table using SQL constructed in Visual Basic, use dates in American format with # delimiters - for example, Select * from PriceHistory WHERE StartDate<=#01/31/2005#
4) If you still have time (unlikely!), write separate code to check the PriceHistory table for gaps - there is no answer included for this!

Thank you for showing an interest in this Access Visual Basic training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content � Wise Owl Business Solutions Ltd 2007.  All rights reserved.  Design by Branches.