Hello,
I have a table on a db2 database that has a binary field. I was told that this field is an image field. I am trying to write an asp page that will display the field.
Here is what I have done
I created an ODBC connection to my DB2 database.
created an sql statement and can see the different fields
Here is the code that I am using.
any help is much appreciated. I am really stummped on this one.
I have a table on a db2 database that has a binary field. I was told that this field is an image field. I am trying to write an asp page that will display the field.
Here is what I have done
I created an ODBC connection to my DB2 database.
created an sql statement and can see the different fields
Here is the code that I am using.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../cls/Connections/agpl.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_agpl_STRING
Recordset1.Source = "select sfid, sfsig from agpl.salefil where sfid = '119141226'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<%
'Set the ContentType to image/gif
Response.ContentType = "image/png"
'Send the binary bits to the browser
Response.BinaryWrite(objRS("sfsig"))
%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
any help is much appreciated. I am really stummped on this one.