 |
<%
dim productType, productNo, productCount, productCode, productPrice, productDescription, productName, productAmount, productImage, productLogo, noOne, x, productNameAlt
dim cnPath, connStr, aQuery, dbName, connObj, rsObj
'assign vars to querystrings
productCount=1
productCode=""
productPrice=0.0
productDescription=""
productAmount=0
productImage=""
productLogo=""
noOne=1
productType=Request.QueryString("productType")
productNo=Request.QueryString("productNo")
if productType="ghd" then
session("productNoGhd")=CStr(productNo)
end if
if productType="tigi-bedhead" then
session("productNoTigi")=CStr(productNo)
end if
'get product typesset path to database
on error resume next
dbName="blackcatDB/products.mdb"
on error resume next
aQuery="SELECT * FROM equipmentType ORDER BY types"
'open and connect to database
on error resume next
cnPath = "DBQ=" + Server.mapPath(dbName)
on error resume next
connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; " + cnPath
on error resume next
Set connObj = Server.CreateObject("ADODB.Connection")
on error resume next
connObj.Open(connStr)
on error resume next
Set rsObj = Server.CreateObject("ADODB.Recordset")
'get record set
on error resume next
rsObj.Open aQuery, connObj,3,3
on error resume next
if rsObj.recordcount>0 then
on error resume next
rsObj.MoveFirst
'if querystring empty
if productType="" or productNo="" then
on error resume next
productType=rsObj("types")
productNo=1
end if
on error resume next
do while not rsObj.EOF
%>
<%
on error resume next
if rsObj("types") = productType then %>
<%=rsObj("types")%>
<%
on error resume next
else %>
&productNo=<%=noOne%>><%=rsObj("types")%>
<%
on error resume next
end if %>
<%
on error resume next
rsObj.MoveNext %>
<%
on error resume next
loop %>
&productType=<%=productType%>&productNo=<%=productNo%>>view cart
&productNo=<%=productNo%>>checkout
|