Home
DBPix
Download
Order
Testimonials
Support
Tutorials
Samples
KnowledgeBase
Links
Revision History
Documentation
Search
Contact
Site Map

Graph: DBPix image storage vs OLE Embedding and Linking in Microsoft Access


DBPix Sample Source Code: item_detail.asp
Back to sample
<%@ LANGUAGE = VBScript %> 
<%  Option Explicit %>
<% 
	Response.Expires = -1			' Ensure that the client-browser doesn't cache 
%>
<html><head><title>ASP Image Database Samples - Remote Editing with XMLHTTP</title>
<!--#include file="adovbs.inc" --><!-- *** VBScipt constants *** -->
<!--#include file="config.inc" --><!-- *** App specifig configuration, connect strings, database locations/DSN's etc *** -->
<!--#include file="common.inc" --><!-- *** common code (eg photo border) *** -->
</head>
<body topmargin="0" leftmargin="0">
<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor=#FFFFFF>
  <tr>
    <td align=center><font face="Arial" size="4" color="#003366"><strong><u>ASP Image Database Samples - Remote Editing with XMLHTTP</u></strong></font>
    </td>
  </tr>
  <tr>
    <td align="center" valign="top"><font face="Arial" size="2" color="#003366"><strong><a href="readme.htm">Documentation</a> &nbsp;<a href="http://www.ammara.com/">DBPix Site</a></strong><br></font><hr size=1>
	<p align="center"><%
	Dim ItemId
	ItemId = Request("itemid")

	If (ItemId <> "") Then 
		Dim cn
		Dim picsset
		Set cn = Server.CreateObject("ADODB.Connection")
		Set picsset = Server.CreateObject("ADODB.Recordset")
		cn.Open GetConnectString
		Dim SQL
		SQL = "SELECT * " &_
		      "FROM tItems " &_
		      "WHERE Id = " & ItemId

		picsset.Open SQL, cn, adOpenStatic, adLockReadOnly, adCmdText

		if not picsset.EOF then
			Response.Write StartImageBorder
%>
<img src="getimage.asp?itemid=<%=ItemId%>&imgid=<%=picsset("ImageId")%>" width="<%=picsset("ImgWidth")%>" height="<%=picsset("ImgHeight")%>" alt="Image (<%=picsset("ImgSize")%> bytes)"><%=FinishImageBorder%>
</p>
      <p align=left><font face="Arial" color="#003366" size="2"><strong>Title:</strong></font><br>
      <font face="Arial" size="2"><%=picsset("Title")%></font></p>
      <p align=left><font face="Arial" color="#003366" size="2"><strong>Description:</strong></font><br>
      <font face="Arial" size="2"><%=picsset("Description")%></font></p>
<%
		end if 'picsset.EOF
		picsset.Close
		Set picsset = Nothing
	end if 'm_sSourceID <> ""
%><p>&nbsp;</p>
	</td>
  </tr>
</table>
</body>
</html>

Back to sample