Homework 4


Deleting Products (50 PTS) 1.  The DeleteProduct.asp deletes products, but it doesn't delete the product's attributes or connections to the departments.  While this is not likely to cause real problems since each new product is given an entirely new idProduct, this could cause some sorts of problems in the future.  You need to modify the DeleteProduct.asp to account for both of these issues.  You will need to use your initials prominently in the name of your new stored procedures so that when they are implemented you won't get conflicts with other users.

The next listing gives the names of the tables that you are most likely going to work with and the precise names of the fields.


ProductAttribute Table


DepartmentProducts Table



Updating Taxes (50 PTS) 2. The UpdateTaxes.asp has two major problems that can be pretty easily improved upon

  1. He lists out all of the states in his code when he has a list of the states in his recordset.
  2. He updates the entries for every state tax rate even if they haven't been changed.

We will start by focusing on part a by modifying the code to use a loop through one of your recordsets to get the name of each state and then appropriately update the tax rate for  only those that have changed entries.

Within the Tax table, the names of the fields with the corresponding information are in the following table.


Tax Rate Info fltTaxRate
State Abbreviation chrState