% @LANGUAGE = VBScript %> <% Option Explicit On Error Resume Next ' In the event of an error, this forces logic to resume at the next statement ' Customer information is not processed. All we are demonstrating here is the ability to delete ' the number of books in stock for this book. ' Connect to the Access database Dim conn set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "D:\Inetpub\wwwroot\home\mhamill\ITD-210\Files\database\books.mdb" ' Use the recordset to issue an update statement to the database Dim rs set rs=Server.CreateObject("ADODB.recordset") ' Get quantity for purchase from the form field; note post method is expected Dim quantity quantity=Request.Form("Quantity") ' Get the book to be purchased. This was passed as a hidden form field. Dim ISBN ISBN=Request.Form("ISBN") ' Create the SQL to decrease available books by the number ordered Dim SQL SQL = "update books set quantity = quantity - " & quantity & " where isbn='" & ISBN & "'" %>
Your credit card has been charged for the amount of $" & Request.Form("Total") & ". You should receive your order within the next few days.
") Response.Write("") conn.Close ' Close connection last set conn = Nothing ' Free the memory %>