<% @LANGUAGE = VBScript %> <% Option Explicit On Error Resume Next ' In the event of an error, this forces logic to resume at the next statement %> Buy a Book
" /> <% ' Get details of 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" ' Create a recordset object so we can query the database to bring up details about the book Dim rs set rs=Server.CreateObject("ADODB.recordset") ' This SQL should retrieve the book from the table. The ISBN is expected to be in the database Dim SQL SQL = "select * from books where isbn='" & Request.QueryString("ISBN") & "'" ' Fetch one row containing the book information rs.Open SQL, conn ' Put up some eye candy so we know it is the right book, etc. Response.Write("

Buy Book: " & rs("title") & "

") Response.Write("

Author: " & rs("author") & "

") Response.Write("

Number Available: " & rs("quantity") & "

") Response.Write("

Cost Each : $" & FormatNumber(rs("price"),2) & "

") ' The hidden form fields are used to calculate the total purchase price %> " /> " /> <% ' When done it's always a good idea to explicitly clean up. rs.Close ' Close recordset first conn.Close ' Close connection last set conn = Nothing ' Free the memory %>
Quantity Wanted:
Total Price:
Name on Credit Card:
Credit Card Type: Visa Mastercard Discover
Credit Card Number:
Card Expiration Date:
Address:
City:
State:
Zip Code:
E-Mail: