<%@ Language=VBScript %> <%Response.Buffer=True Response.ExpiresAbsolute = Now()-1%> <% accessdb="_echeckout\data\NCAMIdata.mdb" myDSN="DRIVER={Microsoft Access Driver (*.mdb)};" myDSN=myDSN & "DBQ=" & server.mappath(accessdb) & "; uid=admin;pwd=enami" dim conntemp2, rstemp2 set conntemp2=server.createobject("adodb.connection") conntemp2.open myDSN set rstemp2=conntemp2.Execute("SELECT * FROM tblEducationalMaterials;") If Request.Form("submit") = " ADD TO ORDER " Then If isObject(Session("objOrder")) Then '-- Use the Object from the Session Set objOrder = session("objOrder") Else '-- Create one if we can't find it Set objOrder = Server.CreateObject("NCNAMI.NAMIOrder") End If Select Case Request.Form("submit") Case " ADD TO ORDER " 'Add the record to the COM recordset For each i in Request.Form If left(i, 10) = "txtHelpqty" Then varLine = Right(i, len(i)-10) varID = "IDNo" & varLine varProd = "txtPRODID" & varLine varQty = "txtHelpqty" & varLine varDesc = "txtPRODDesc" & varLine varAmt = "txtAMT" & varLine varTot = "txtHelpTot" & varLine If Len(Request.Form(varQty)) > 0 and Not isnull(Request.Form(varQty)) Then objOrder.AddRecord CInt(Request.form(varID)), CDate(Trim(now())), CInt(Request.Form(varProd)), Request.Form(varDesc), CInt(Request.Form(varQty)), CCur(Request.Form(varAMT)), CCur(Request.Form(varTot)) End IF End IF Next 'set the records to the Recordset object set RS = objOrder.GetRecords intrecordsadded = rs.RecordCount 'Response.Redirect "orderview.asp" Response.Write "You have ordered " & intrecordsadded & " item(s)." %> Click OR to complete your order. You may also add other items to your order. <% End Select End IF %>

NAMI NC Publications Ordering Form

Shipping Handling and Tax are included in the price. For large quantity discounts call the NAMI NC office.
Enter the quantity, click Add To Order when done.
<% i = 0 do while not rstemp2.eof i = i + 1 Randomize(Cbyte(Left(Right(Time(),5),2))) %> <%If rstemp2("Amount") < 0 Then%> <%Else%> <%End IF%> <% rstemp2.movenext loop %>    
AMT QTY TOTAL
<%=rstemp2("Product")%> "> ">     $<%=rstemp2("Amount")%>">

Total
<%rstemp2.close set rstemp2=nothing %>

<% 'Dont forget this or you just get 1 record If Request.Form("submit") = " ADD TO ORDER " Then Set session("objOrder") = objOrder End IF %>