<% session.timeout = 360 ' 6 hours dim cart() if isempty(session("cart")) then redim cart(4, 1) else cart = session("cart") end if function add_cart(id, bResin) on error resume next dim rsPricing, rsPhoto, bound, i, index dim idArr(), titleArr(), priceArr(), quanArr(), resinArr() id = cLng(id) bound = uBound(cart) for i = 0 to bound if cart(i, 0) = id then cart(i, 3) = cart(i, 3) + 1 add_cart = true exit function end if next set rsPricing = ado.execute("exec sp_getPricing @idPricing="& id) if err.number <> 0 then add_cart = err.description exit function elseif rsPricing.recordCount = 0 then add_cart = "Could not retrieve pricing information." exit function end if set rsPhoto = ado.execute("exec sp_getPhotograph "& rsPricing("idPhoto")) if err.number <> 0 then add_cart = err.description exit function elseif rsPricing.recordCount = 0 then add_cart = "Could not retrieve photograph information." exit function end if index = bound + 1 redim preserve cart(4, index) cart(index, 0) = id cart(index, 1) = rsPhoto("title") cart(index, 3) = 1 if bResin = true then cart(index, 2) = rsPhoto("resin_price") cart(index, 4) = true else cart(index, 2) = rsPhoto("price") cart(index, 4) = false end if session("cart") = cart add_cart = true end function %>