|
-
Jun 28th, 2001, 03:38 AM
#1
Thread Starter
Hyperactive Member
Showing picture I have in database
How do I make a picture I have in an Access database be seen in a web page?
It is saved as an OLE object in the database. Thanks
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
-
Jun 28th, 2001, 01:59 PM
#2
Frenzied Member
just put the path of your picture in your db!!
and do something like(when yu retrieve your record set)
<img src="<%=rs("picture")%>" border="0">
-
Jun 29th, 2001, 10:28 PM
#3
Thread Starter
Hyperactive Member
Wow that was simple!
And I was here going crazy. Darn 24-hour books. grrr...
Thanks a lot!!
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
-
Jun 29th, 2001, 10:41 PM
#4
Thread Starter
Hyperactive Member
But unfortunately it does not work when I have something like
While Not objRS.EOF
Response.Write "<img src="<%=rs("picture")%>" border="0"> "
objRS.MoveNext
Wend
I have a couple of them in the database! What can I do?
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
-
Jun 29th, 2001, 10:58 PM
#5
Lively Member
try this buddy..
Code:
While Not objRS.EOF
Response.Write '<img src=' & rs("picture") & ' border="0"> '
objRS.MoveNext
Wend
MohamadHassan<equuelus@icqmail.com>
Javascript,VBScript,ASP,LearningVBfor.NET
ICQ:7205608

-
Jun 30th, 2001, 10:43 PM
#6
Thread Starter
Hyperactive Member
Sorry guys but none of the ways youve given me seem to work;. Perhaps what I did wrong was the way I stored the pictures in the database. (theyre jpegs by the way)
I defined the field as an OLE object, then right clicked on it and selected insert object. Then I selected 'image' and browsed to the file. Do you know if my error is there?
How did you guys store the picture?
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
-
Jul 1st, 2001, 11:11 PM
#7
Thread Starter
Hyperactive Member
Is it better if its a gif?
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
-
Jul 3rd, 2001, 05:16 AM
#8
Fanatic Member
According to Wrox - Profesional ASP 2.0 an image can be displayed in an asp page with the following code.
<%@ Language=VBScript %>
<% 'Clear out the existing HTTP header information
Response.Expires=0
Response.buffer=true
Response.Clear
'Change the HTTP header to reflect that an image is being passsed
Response.ContentType="image/gif"
set cn=Server.CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=isd03"
set objRs = cn.Execute("select logo from pub_info where pub_id = '0877'")
Response.BinaryWrite(objRs("logo"))
Response.End
%>
It works for me intermitently, may you would have more luck or someone else can help with soem refinements.
Sorry I can't help you specifically...
-
Jul 3rd, 2001, 10:44 PM
#9
Thread Starter
Hyperactive Member
I cannot use
Response.ContentType="image/gif"
because I have numers, text and pictures in the recordset. I want to display the text and the picture that matches the query.
Top Tip: You can make friends and impress the opposite sex at geeky cocktail parties by saying "DB" instead of database. - Karl Moore
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
|