DBPix Sample Source Code: detail.asp Back to sample
<%@ LANGUAGE=VBScript %>
<% OPTION EXPLICIT %>
<%
Dim cn
Dim picsset
Dim sqlselect
Dim m_sSourceID
%>
<html>
<head>
<title>DBPix Samples: Simple ASP Publishing - Item Detail</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>
<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><hr size="1"></td>
</tr>
<%
m_sSourceID = Request("itemid")
If (m_sSourceID <> "") Then
Set cn = Server.CreateObject("ADODB.Connection")
Set picsset = Server.CreateObject("ADODB.Recordset")
cn.Open GetConnectString
sqlselect = "SELECT Id, Title, Description, ImageWidth, ImageHeight " &_
"FROM tphotos " &_
"WHERE Id = " & m_sSourceID
picsset.Open sqlselect, cn, adOpenStatic, adLockReadOnly, adCmdText
if not picsset.EOF then
%>
<tr>
<td valign="top" width="165"><font face="Arial" size="2">
<p><strong>Title:</strong><br><%=picsset("Title")%></p>
<p><strong>Description:</strong><br><%=picsset("Description")%></p><br>
<img src="getimage.asp?field=Image&imgid=<%=picsset("Id")%>" width="<%=picsset("ImageWidth")%>" height="<%=picsset("ImageHeight")%>">
<p> </p>
</td>
</tr>
<%
end if 'picsset.EOF
picsset.Close
Set picsset = Nothing
end if 'm_sSourceID <> ""
%>
</table>
</body>
</html>
Back to sample
|