|
-
Jan 26th, 2005, 06:52 AM
#1
Thread Starter
New Member
Retriving images from database
Hey all I need some help with displaying some images that are in a database. Currently when I try to display them they come out in binary form and I am stumped on how to correct it.
Server info:
WWW Server:
Windows Server 2003
ASP .Net
Pages are .aspx written in VBScript
Database Info:
MS SQL Server 2000
Problem code:
<%
Dim rs
rs = Server.CreateObject("adodb.recordset")
rs.Open("Select * From avatar", Application("Conn"))
If not rs.eof then
Do Until rs.eof
Response.ContentType = "image/gif"
Response.binarywrite(rs.fields("a_avatar").value)
rs.movenext
Loop
rs.close
End If
%>
As stated above the result is display of the three images in the database in binary form.
http://test.adiktclan.com/test.aspx
Any help is greatly appreciated.
Thanks,
John K
MCSA, A+
-
Jan 26th, 2005, 08:47 AM
#2
Re: Retriving images from database
Have you seen the suggestion I made here http://www.vbforums.com/showthread.p...tpost&t=321793
Its best not to cross post in 2 forums, most of us visit DB & ASP forums.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jan 26th, 2005, 09:45 AM
#3
Thread Starter
New Member
Re: Retriving images from database
I have tried setting the page up that way but it produces the same that i am already getting witch is like 20 pages of binary with small littel image boxes at the start of each each image
-
Jan 26th, 2005, 10:09 AM
#4
Re: Retriving images from database
 Originally Posted by mcp87
I have tried setting the page up that way but it produces the same that i am already getting witch is like 20 pages of binary with small littel image boxes at the start of each each image
What did you define the field type as?
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jan 26th, 2005, 12:22 PM
#5
Thread Starter
New Member
Re: Retriving images from database
I am asuming you are refering the field in the database, that field is defined as image
Please post future responses on topic in database section
http://vbforums.com/showthread.php?t=321793
Last edited by mcp87; Jan 27th, 2005 at 04:01 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|