dbBLOB

Display BLOB field in an in-call and HREF manner. Different DB has their BLOB fields defined differently. The fields are sometimes stored with a header. Use must know the format of these BLOBs in order to have them displayed properly.

Property Syntax

Obj.dbBLOB="Field, Context-Type, Replacement_Text, BLOB Offset"

Parameters

Parameters

Description

Field FieldNameOrNumber is the Database’s field that is of  BLOB type (72, 128, 204, 205).
Context-Type The HTML context type (image/jpg, image/bmp, image/gif, application/msexcel etc.)  These can be found in your browser’s “Helper Apps”).

2005 new attribute - Auto (Autodetect BLOB Type - gif, jpg, png and pdf only). You can mix the type of Blobs stored in the field. Applies to Link only and not inline. Inline does not need any context.
e.g.
      .dbBlob = "Pic, auto, Hyperlink to Blob, 0"
 

Replacement_Text This text will be displayed when Linked images are used instead of in-line images.
BLOB Offset

Every database implements BLOBs differently. When binary objects are stored in the data field with an attached header, you must determine how many bytes (if any) are delivered in front of the actual binary data.  Some examples are:

  • ACCESS OLE-OBJ field containing BMP images – Offset = 78 (NWIND Employee Table example)

  • Borland Paradox’s BLOB field storing images (Biolife example) – Offset = 8

Set Offset to –1 if hyperlinking is not desired. In this case, the image will be displayed “in-line”.

 

Example

X.dbBLOB="Photo,image/bmp,Employee Picture,78"
X.dbBLOB="Photo,,Employee Picture,-1"

How toI display BLOB fields embedded in MS SQL fields
The pubs.pr_info table has an embedded BLOB field "Logo" containing embedded GIF images in the field.  Apply the dbBLOB property to display the image inside the cell directly from the field.  Note that you can only display images directly supported by the browser in an inline mode (GIF, JPG and PNG).  

<%response.buffer=true%>
<CENTER><h2>In-Cell image Demo</h2>
<%
Set X=Server.CreateObject("Asp.DB")
X.dbUnit=1
X.dbDSN="DSN=SQL7-PUBS; UID=sa; PWD="
X.dbDBType="SQL"
X.dbmode="grid"
X.dbSQL="Select * FROM pub_info"
X.dbGridHideFlds="2"
X.dbGridTableTag="BORDER=1"
'to display inlcell gif 
X.dbBLOB="Logo,image/gif,browser,0"
X.ASPdb
%>
<P><CENTER><h2>Hot Linked image Demo</h2>
<%
X.dbUnit=2
X.dbDSN="DSN=SQL7-PUBS; UID=sa; PWD="
X.dbSQL="Select * FROM pub_info"
X.dbGridHideFlds="2"
X.dbBLOB="Logo,image/gif,Click for Image of - #ASPdbIndex#,0"
X.ASPdb
%>
</CENTER>

Output

 

Notes

The above example demonstrate how to display BLOBs in-cell and in Link mode. Note that The BLOB text is going through the Macro filter and is a new feature of ASPdb2001.