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: detail_.asp
Back to sample
<%@ LANGUAGE = VBScript %> 
<% 
	Dim m_sSourceID
  Dim picsset
  Dim cn

	' Ensure that the client-browser doesn't cache 
  ' In a production system you may wish to allow a short time here, depending on the frequency of updates
	Response.Expires = 0
	m_sSourceID = Request("itemid")
%>
<html>
<head>
<title>Pics</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<!-- *** Defines various constants for VBScipt database operations *** -->
<!--#include file="adovbs.inc" -->
<!-- *** App specifig configuration, connect strings, database locations/DSN's etc *** -->
<!--#include file="config.inc" -->
</head>
<SCRIPT for=window event=onload language=javascript>
<!--
  window.focus();
  window.resizeTo(<%=Request("Width")%>,<%=Request("Height")%>);
-->
</SCRIPT>
<body background="images/backgrnd.gif" topmargin="0" leftmargin="0">
<div align="center"><center>
<%
	If (m_sSourceID <> "") Then 
	  Set cn = Server.CreateObject("ADODB.Connection")
	  Set picsset = Server.CreateObject("ADODB.Recordset")
	  cn.Open GetConnectString
	  sqlselect = "SELECT * " &_
				  "FROM tphotos " &_
				  "WHERE Id = " & m_sSourceID
	  picsset.Open sqlselect, cn, adOpenStatic, adLockReadOnly, adCmdText
  	if not picsset.EOF then
%>
<table border="0" width="90%" cellpadding="10" background="images/backgrnddk.gif">
  <tr>
    <td align="center" valign="top"><img src="image_.asp?imgid=<%=picsset("Id")%>" width="<%=picsset("detailw")%>" height="<%=picsset("detailh")%>" alt="Image (<%=picsset("detailbytes")%> bytes)">
    </td>
  </tr>
</table>
	<%
	  	end if 'picsset.EOF
      picsset.Close
      Set picsset = Nothing
  	end if 'm_sSourceID <> ""
	%>
<p><input type="button" value="Close" width="60" name="close" style="WIDTH: 60px" LANGUAGE=javascript onclick="return close_onclick()"></p>
</center></div>
</body>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function close_onclick() {
  window.close();
}
-->
</SCRIPT>
</html>

Back to sample