Featured Product
<%
'Display a featured product
Set rsprod = Server.CreateObject("ADODB.Recordset")
rsprod.Open "select * from products where featured=true" , db, adOpenStatic, adLockReadOnly
rmax=rsprod.recordcount
if not rsprod.eof then
t=Timer
Randomize t
rnum = Int(RND * rmax)
rsprod.move rnum
'set rsprod=db.execute("select * from products")
if not rsprod.eof then
%><%= rsprod("name") %>
<%= rsprod("image") %>
<% if rsprod("saleprice")="" or rsprod("saleprice")=0 then %>Price: <%= cursymbol & formatnumber(rsprod("price")) %><% else %>Price: <%= cursymbol & formatnumber(rsprod("price")) %>
Sale: <%= cursymbol & formatnumber(rsprod("saleprice")) %><% end if %>
<%= rsprod("description") %>
<%
end if
%>
<%
end if
db.Close
Set db = Nothing
%>