Query.asp
[code=asp]
<%@ LANGUAGE="VBSCR IPT" %>
<!-- #include file="../../includes/dbconn.asp"-->
<%
dim MyRs, sqlstr, MyConn
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear
Response.Conten tType = "image/gif"
Set MyConn = Server.CreateOb ject("ADODB.Con nection")
MyConn.Open dbConn
Set MyRs = Server.CreateOb ject("ADODB.Rec ordset")
sqlstr="select img from img"
MyRs.Open sqlstr, MyConn, adOpenKeyset, adLockOptimisti c
Response.Binary Write MyRs("img")
Response.End
MyRs.Close
MyConn.Close
set MyRs=nothing
set MyConn= nothing
%>[/code]
Main.asp
[code=html]
<HTML>
<HEAD><TITLE>Di splay Image</TITLE></HEAD>
<BODY>
This page will display the image New Moon Books from a SQL Server
image field.<BR>
<IMG SRC="Query.ASP" >
</BODY>
</HTML>[/code]
why can't display, really dunno what to do
[code=asp]
<%@ LANGUAGE="VBSCR IPT" %>
<!-- #include file="../../includes/dbconn.asp"-->
<%
dim MyRs, sqlstr, MyConn
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear
Response.Conten tType = "image/gif"
Set MyConn = Server.CreateOb ject("ADODB.Con nection")
MyConn.Open dbConn
Set MyRs = Server.CreateOb ject("ADODB.Rec ordset")
sqlstr="select img from img"
MyRs.Open sqlstr, MyConn, adOpenKeyset, adLockOptimisti c
Response.Binary Write MyRs("img")
Response.End
MyRs.Close
MyConn.Close
set MyRs=nothing
set MyConn= nothing
%>[/code]
Main.asp
[code=html]
<HTML>
<HEAD><TITLE>Di splay Image</TITLE></HEAD>
<BODY>
This page will display the image New Moon Books from a SQL Server
image field.<BR>
<IMG SRC="Query.ASP" >
</BODY>
</HTML>[/code]
why can't display, really dunno what to do
Comment