求助用ASP显示图片的问题!
以下是在下写程序,不知为什么显示图片那里总是显示乱码,请高手指教!
不知我在ACCESS数据库那里把图片字段设成OLE对象,并选“文件”--》浏览选择JPEG图片有无不妥?
<HTML>
<HEAD></HEAD>
<BODY>
<form name=f_chk_cert method="POST" action="#" >
<p>Please input the 6-digit certificate number: <br>
<input type="text" name="TCERT_ID" size="6" maxlength="6" ><br>
<input type="SUBMIT" value="SUBMIT" name="SUBMIT">
<input type="RESET" value="RESET" name="RESET">
<br><br></p>
</form>
<HR color=red>
<Table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
<%
dim sql
dim outstr
If Request.ServerVariables("Request_Method")="POST" then
Response.Expires=0
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("certlist2.mdb") & ";Mode=ReadWrite|Share Deny None;Persist Security Info=False"
sql="select * from certlist where certlist.certid = '" & Request.form("tcert_id") & "'"
Set RS=Server.CreateObject("ADODB.RecordSet")
RS.Open sql,conn,3,2
if RS.RecordCount > 0 then
Response.BinaryWrite RS("img")
outstr="<TR>"
outstr=outstr & "<TD><B>Certificate No.:</B></TD><TD>" & RS("certid") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>Certificate Type:</B></TD><TD>" & RS("cert_type") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>License Holder:</B></TD><TD>" & RS("applicant") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>Manufactory:</B></TD><TD>" & RS("manufactory") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>Product:</B></TD><TD>" & RS("product") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>Model:</B></TD><TD>" & RS("model") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>EDate:</B></TD><TD>" & RS("EDate") & "</TD>"
outstr=outstr & "</TR><TR>"
outstr=outstr & "<TD><B>Status:</B></TD><TD>" & RS("status") & "</TD>"
outstr=outstr & "</TR>"
outstr=outstr & "</Table><HR color=red>Notice: The information in this page is for user internal reference purpose only. No warranty or fitness for particular purpose may be derived therefore. Please always call for the latest information.<p> </p><p> </p><p> </p>"
else
outstr="<TR><TD></TD></TR></Table>"
outstr=outstr & "Sorry, no match found, please verify your data entry. <br><br>"
outstr= outstr & "If this message continues, the reason may be: <br>"
outstr= outstr & "1. It is not a valid certificate (report) number.<br>"
outstr= outstr & "2. It is not registered yet at the time being.<br><br>"
outstr= outstr & "Please call us for additional assistance.<p> </p><p> </p><p> </p><p> </p>"
end if
Conn.Close
Set Conn=Nothing
Response.Write(outstr)
else
%>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</table>
<%
end if
%>
</TABLE>
</BODY>
</HTML>