title: View image from object ole db sql in classic asp
body: <p>i am looking for a way to display in classic asp an image stored in an ole object of a sql db.
  I've been looking around for a while, and the only thing I've found is such a thing that I've readjusted for my needs.
  Unfortunately, however, it does not work, you only see a small square with a central x.
  Do you have a suggestion?
  Thanks</p>
  <pre><code>&lt;%@LANGUAGE = VBScript%&gt;
  </code></pre>
  <p>&lt;%
  id = Request.Querystring(&quot;id&quot;)</p>
  <pre><code>Set Conn1 = Server.CreateObject(&quot;ADODB.Connection&quot;)
  Conn1.open &quot;Driver={SQL Server};Server=ARCA;Database=CDB_EVEREX;Uid=everex;Pwd=everex1989;&quot;
  
  Dim strSQL, Rs
  Set Rs = Server.CreateObject(&quot;ADODB.Recordset&quot;) 
  
  strSQL = &quot;SELECT * FROM Attrezzatura_Catalogo WHERE ID_Catalogo=&quot; &amp; id &amp; &quot;;&quot;
  Rs.Open strSQL, Conn1, 3, 1
  
  ' Clear out the existing HTTP header information
  'Response.Expires = 0
  'Response.Buffer = TRUE
  'Response.Clear
  
  ' Change the HTTP header to reflect that an image is being passed.
  Response.ContentType = &quot;image/bmp&quot;
  
  Response.BinaryWrite Rs(&quot;Immagine&quot;) 
  'Response.End
  
  Rs.Close
  Conn1.Close
  Set Conn1 = Nothing
  </code></pre>
  <p>%&gt;</p>