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: get_item_atg.asp
Back to sample
<%  @ LANGUAGE=VBScript %>
<%  Option Explicit %>
<!--#include file="config.inc" -->
<!--#include File="adovbs.inc"-->
<% 
	Response.Buffer = TRUE
	Response.Expires = 0 

	Dim rs 
	Dim SQL
	Dim ItemId

	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.CursorLocation = adUseClient

	ItemId = Request("itemid")
	If (ItemId <> "") Then 
		SQL = "SELECT tItems.* " &_
		      "FROM tItems " &_
		      "WHERE tItems.Id = " & ItemId

		rs.open SQL, GetConnectString, adOpenKeyset, adLockBatchOptimistic
		Set rs.ActiveConnection = Nothing

		If (ItemId = "0") Then 
			rs.AddNew
			rs("ImageVersion") = 1
			rs.Update
		End If

		if NOT (rs.EOF AND rs.BOF) then
			Response.ContentType = "image/jpeg"

			rs.Save Response, adPersistADTG
		end if
		rs.Close
	end if
	Set rs = Nothing
	Response.End
%>

Back to sample