Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query results 1

Status
Not open for further replies.

mimi2

Technical User
Apr 2, 2002
407
CA
hello, i am trying to use ASP for something that can't be done in coldfusion: displaying blob objects.
for a single id, i can have 3 images.
is there a way i could loop to display the 3 objects using the following code (that i copied somewhere)
thanks.

<%
Dim oConn
Dim oRS
Dim icolpo

Response.Expires=0
Response.Buffer=True
Response.Clear

Response.contentType = &quot;image/tif&quot;

Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
oConn.Open &quot;Provider=SQEDB;User ID=someone; Password=someone; Initial Catalog=Test;Data
Source=DBTest&quot;
IF Request.QueryString =&quot;&quot; THEN
Response.Write &quot;nothing&quot;
ELSE

Set oRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
oRs.Open &quot; SELECT image&quot; & _
&quot; FROM DB1 d JOIN DB2 i
on i.id = d.id&quot; & _
&quot; WHERE i.second_id = &quot; & _
Request.QueryString(&quot;second_id&quot;), oConn


Response.BinaryWrite oRS(&quot;image&quot;)

Response.end

END IF

'Close the recordset
oRS.Close
SET oRS = Nothing

'Close the connection
oConn.Close
Set oConn = Nothing

%>








 
While Not oRS.EOF
Response.BinaryWrite oRS(&quot;image&quot;)
oRS.MoveNext
Wend

 
Thanks. I got an answer from another forum saying that is not possible when blobs are stored in the database !
 
My apologies. On experimenting I find that MoveNext does not seem to work with a recordset that includes a BLOB.

In fact diplaying an image seems to require rather a lot of steps.

Sorry about that mistaken reply.
 
Why blob? why not use image link? =/ www.vzio.com
star.gif
if I helped. [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top