<%
Option Explicit
If IsEmpty(Request.Form("CalculateTax")) Then
  Response.Redirect "./shopping_cart.asp"
End If
Dim conn
Dim RSFooter
Dim RSTotal
Dim RSCCTypes
set conn = server.createobject ("adodb.connection")
conn.open "ASPBook", "sa", "nep2tune"
conn.execute "insert into ASPSessionPages (SessionID, PageName) values (" _
  & Session("SessionID") & ", " _
  & "'CheckOut')"
set RSFooter = conn.execute("select BriefText from ASPPageText " _
  & "where PageName = 'Footer'")
set RSTotal = conn.execute("select Sum(ItemPrice) as TheTotal from " _
  & "ASPSessionItems where SessionID = " & Session("SessionID"))
conn.execute "update ASPSessions set TaxTotal = " & (RSTotal("TheTotal") _
  * Request.Form("Location")) _
  & " Where SessionID = " & Session("SessionID")
set RSTotal = conn.execute("Select ProductTotal, ShippingTotal, " _
  & "TaxTotal from ASPSessions " _
  & " Where SessionID = " & Session("SessionID"))
conn.execute "update ASPSessions set OrderTotal = " & (RSTotal("ProductTotal") _
  + Request.Form("ShippingTotal") + Request.Form("TaxTotal")) _
  & " Where SessionID = " & Session("SessionID")
set RSCCTypes = conn.execute("select CCType from ASPCCTypes order by CCType")
%>   
