<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> Tractor Imports Kubota Tractors <% dim categoryId dim line dim DspCat dim DspName line = 0 ' Get the category to dispplay DspName = request.form("stock") select case Dspname case "" DspCat = "web_tractors" case "Tractors" DspCat = "web_tractors" case "Forklifts" DspCat = "web_forklifts" case "Engines" DspCat = "web_engines" case "Construction" DspCat = "web_construction" end select Sub getCategory() Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open dbConnectionStr SQLQuery = "SELECT categoryID FROM tblCategory WHERE categoryName = '" & DspCat & "';" Set ds = objConn.Execute(SQLQuery) if not ds.bof AND not ds.eof then categoryId = ds("categoryID") end if set ds = nothing objConn.close end sub Sub getProducts() Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open dbConnectionStr SQLQuery = "SELECT tblProducts.productName, tblProducts.productCode, tblProducts.shortDescription, tblProducts.image1, tblproducts.image1Large, tblProducts.retailPrice, tblProducts.dateAvailable FROM ((tblProducts LEFT JOIN tblProducts_Categories ON tblProducts.productID = tblProducts_Categories.productID) LEFT JOIN tblCategory ON tblProducts_Categories.categoryID = tblCategory.categoryID) WHERE tblProducts_Categories.categoryID=" & categoryID & " ORDER BY tblproducts.displayOrderGroup, tblProducts.productName;" Set ds = objConn.Execute(SQLQuery) end sub %>
   
  Used Tractors & Machinery
 
<% getCategory() getProducts () if not ds.bof AND not ds.eof then %> <% do until ds.eof