Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%
response.expires = 0
response.cachecontrol = "private"
%>
<!-- #include file="adovbs.inc" -->
<%
homepage = "index.htm"
' Define SQL statements for the page and items.
itemsql = "select sku, name, price, abstract, show from tblproducts order by name"
' Establish a database connection.
set conn = Server.CreateObject("ADODB.Connection")
openstr = "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & server.mappath("database\wpt.mdb")
conn.open openstr
' Define and open recordsets for the page and items.
set itemrs = Server.Createobject("ADODB.RecordSet")
itemrs.open itemsql, conn, adopenstatic, adlockreadonly
%>
<html>
<head>
<title>Image catalog</title>
</head>
<body>
<%
if not itemrs.eof then
' Create a table for all of the images.
response.write "<table border=" & chr(34) & "0" & chr(34) & ">" & vbcrlf
' Counter is the item index.
counter = 1
' Limit is the number of items we want per row.
limit = 3
do while not itemrs.eof
' Step through the recordset placing images into their own cells.
' At LIMIT close the table row and start another table row.
if counter = 1 then
' Write table row if this is the first image.
response.write "<tr>" & vbcrlf
end if
' Write table cell with image as a link to detail page.
response.write "<td valign=" & chr(34) & "top" & chr(34) & ">" & vbcrlf & _
" <a href=" & chr(34) & "item.asp?catid=&itemid=" & _
itemrs("sku") & chr(34) & ">" & vbcrlf & "<img src=" & chr(34) & _
"images/" & itemrs("thumbnail") & chr(34) & _
" border=" & chr(34) & "0" & chr(34) & _
" alt=" & chr(34) & server.htmlencode(itemrs("name")) & chr(34) & _
" width=" & chr(34) & "110" & chr(34) & _
" height=" & chr(34) & "110" & chr(34) & _
"></a></td>" & vbcrlf
' Increment the counter.
counter = counter + 1
' If limit is reached, close the row and reset the counter.
if counter > limit then
response.write "</tr>" & vbcrlf
counter = 1
end if
' Advance the recordset pointer to the next record.
itemrs.movenext
loop
' Fill out the row for any remaining cells.
if counter > 1 and counter <= limit then
do while counter <= limit
response.write "<td></td>" & vbcrlf
counter = counter + 1
loop
'Close the table row.
response.write "</tr>" & vbcrlf
end if
' Close the table.
response.write "</table>"
end if
%>
</body>
</html>