DBPix Sample Source Code: default.asp Back to sample
<%@ LANGUAGE=VBScript %>
<% OPTION EXPLICIT %>
<%
Dim cn
Dim picsset
Dim sqlselect
%>
<html>
<head>
<title>DBPix Samples: Simple ASP Publishing</title>
<!--#include file="adovbs.inc" --><!-- *** ADO constants include file for VBScript *** -->
<!--#include file="config.inc" --><!-- *** App specifig configuration, connect strings, database locations/DSN's etc *** -->
</head>
<body topmargin="10" leftmargin="10">
<table border="0" cellpadding="0" cellspacing="4" width="712">
<tr>
<td colspan="2">
<p align="center"><font face="Arial" size="4" color="#003366"><strong>DBPix Samples: ASP Publishing</strong></font></p>
<p align="center"><font face="Arial" size="2" color="#003366"><strong>View Sample <a href="readme.htm">Documentation</a> <!--<a href="simpasp.zip">Download</a> --><a href="http://www.ammara.com/">DBPix Site</a><strong></font></p>
</td>
</tr>
<tr>
<td colspan="2"><hr size="1"></td>
</tr>
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set picsset = Server.CreateObject("ADODB.Recordset")
cn.Open GetConnectString
sqlselect = "SELECT Id, Title, Description, ImageWidth, ImageHeight, ThumbWidth, ThumbHeight " &_
"FROM tPhotos " &_
"ORDER BY Id"
picsset.Open sqlselect, cn, adOpenStatic, adLockReadOnly, adCmdText
while not picsset.EOF
%>
<tr>
<td valign="top" width="165">
<a href="detail.asp?itemid=<%=picsset("Id")%>">
<img src="getimage.asp?field=Thumb&imgid=<%=picsset("Id")%>" width="<%=picsset("ThumbWidth")%>" height="<%=picsset("ThumbHeight")%>" alt="Picture"></a>
</td>
<td valign="top">
<font face="Arial" size="2">
<strong>Title:</strong><br>
<%=picsset("Title")%><br><br>
<strong>Description:</strong><br>
<%=picsset("Description")%></font>
</td>
</tr>
<tr>
<td colspan="2"><hr size="1"></td>
</tr>
<%
picsset.MoveNext
wend
%>
</table>
<p> </p>
</body>
</html>
Back to sample
|