<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% 'this record set it modified to determin if a parameter is passed or not ' if yes it builds a filtered recordset ' if not it builds a unfilterd recordset Dim rsInventory Dim rsInventory_cmd Dim rsInventory_numRows Dim passedParam passedParam = request.QueryString("categoryID") If passedParam <> "" then Dim rsInventory__MMColParam rsInventory__MMColParam = "1" If (Request.QueryString("categoryid") <> "") Then rsInventory__MMColParam = Request.QueryString("categoryid") End If Set rsInventory_cmd = Server.CreateObject ("ADODB.Command") rsInventory_cmd.ActiveConnection = MM_conAcme_STRING rsInventory_cmd.CommandText = "SELECT * FROM acmedemo.Inventory WHERE category = ?" rsInventory_cmd.Prepared = true rsInventory_cmd.Parameters.Append rsInventory_cmd.CreateParameter("param1", 200, 1, 20, rsInventory__MMColParam) ' adVarChar Set rsInventory = rsInventory_cmd.Execute rsInventory_numRows = 0 else Set rsInventory_cmd = Server.CreateObject ("ADODB.Command") rsInventory_cmd.ActiveConnection = MM_conAcme_STRING rsInventory_cmd.CommandText = "SELECT * FROM acmedemo.Inventory " rsInventory_cmd.Prepared = true rsInventory_cmd.Parameters.Append rsInventory_cmd.CreateParameter("param1", 200, 1, 20, rsInventory__MMColParam) ' adVarChar Set rsInventory = rsInventory_cmd.Execute rsInventory_numRows = 0 end if %> <% Dim rsProdCatergory Dim rsProdCatergory_cmd Dim rsProdCatergory_numRows Set rsProdCatergory_cmd = Server.CreateObject ("ADODB.Command") rsProdCatergory_cmd.ActiveConnection = MM_conacme_STRING rsProdCatergory_cmd.CommandText = "SELECT * FROM acmedemo.categories WHERE categoryID = ?" rsProdCatergory_cmd.Prepared = true rsProdCatergory_cmd.Parameters.Append rsProdCatergory_cmd.CreateParameter("param1", 5, 1, -1, rsProdCatergory__MMColParam) ' adDouble Set rsProdCatergory = rsProdCatergory_cmd.Execute rsProdCatergory_numRows = 0 %> <% 'detremins if a value is passed and generates the apropriate title and header Dim txtTitle Dim txtHeader if passedParam <> "" then txtTitle = "Acme Procucts Catalog" txtHeader = "Acme Procucts Catalog" else txtTitle = "Acme Procucts Catalog" txtHeader = "Acme Procucts Catalog" end if %> <% Dim rsProdCatergory__MMColParam rsProdCatergory__MMColParam = "1" If (Request.QueryString("categoryID") <> "") Then rsProdCatergory__MMColParam = Request.QueryString("categoryID") End If %> <% Dim idSession idSesion = session.SessionID %> <%= txtTitle %>
<% Dim HLooper1__numRows HLooper1__numRows = -3 Dim HLooper1__index HLooper1__index = 0 rsProducts_numRows = rsProducts_numRows + HLooper1__numRows %>

<%= txtHeader %>

<% startrw = 0 endrw = HLooper1__index numberColumns = 3 numrows = -1 while((numrows <> 0) AND (Not rsInventory.EOF)) startrw = endrw + 1 endrw = endrw + numberColumns %> <% While ((startrw <= endrw) AND (Not rsInventory.EOF)) %> <% startrw = startrw + 1 rsInventory.MoveNext() Wend %> <% numrows=numrows-1 Wend %>
" title="Get more information about <%=(rsInventory.Fields.Item("ItemName").Value)%>"> " alt="image of <%=(rsInventory.Fields.Item("ItemName").Value)%> Product" />
<%=(rsInventory.Fields.Item("itemName").Value)%>
<%= FormatCurrency((rsInventory.Fields.Item("itemPrice").Value), -1, -2, -2, -2) %>
# in Stock: <%=(rsInventory.Fields.Item("stock").Value)%>
" title="Add the <%=(rsInventory.Fields.Item("itemName").Value)%> to the cart">Purchase <%=(rsInventory.Fields.Item("itemName").Value)%>
<% rsProducts.Close() Set rsProducts = Nothing %> <% rsProdCatergory.Close() Set rsProdCatergory = Nothing %>