Hi
I'm trying to pull an image reference held as a text field in an access database and display it, code of the page is below.
response.Write "<img Src="" & image & ></img></tr></td>"[/code]
rs.movenext
x=x+1
loop
'response.write "<tr><td colspan=7>Total Records : " & x & "</table>"
rs.close
conn.close
set conn=nothing
end if
set conn = nothing
%>
<%end select%>
<head>
<LINK REL=STYLESHEET HREF=" TYPE="text/css">
<style>
a:hover{color:red}
</style>
<title>Image Page</title>
</head>
[/code]
The problem is the returned article gives this
displaying the red X of no image even if the image resides in the same folder as the database, I can worry about paths later I just want to get the image display working.
TIA
I'm trying to pull an image reference held as a text field in an access database and display it, code of the page is below.
Code:
<%
option explicit
dim useraction
dim dsn,sql,conn,rs,flag,color,x
dim fname,lname,tel,mobile,init,dept,id,image
id=request("id")
useraction=request("action")
dsn="DBQ=" & Server.Mappath("../db/picphone.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
set conn=server.createObject("adodb.connection")
conn.open dsn
select case useraction
case "display"
sql = "select * from users where id="&id
set rs = conn.execute(sql)
lname=rs("lname")
fname=rs("fname")
tel=rs("tel")
mobile=rs("mobile")
init=rs("init")
dept=rs("dept")
image=rs("image")
if rs.eof and rs.bof then
response.write "No Record Found"
else
response.write "<table width=550 border=0 align=left><th align=left>Last Name</th><th align=left>First Name</TH>"
response.write "<th align=left>Tel</TH><th align=left>Mobile</TH><th align=left>Initials</TH><th align=left>Dept</TH>"
response.write "<th align=left>Picture</TH>"
do while not rs.eof
if flag=0 then
flag=1
color="#DFEFFD"
else
flag=0
color="#DDEOE3"
end if
response.write "<TR bgcolor="& color & "><TD>"
response.write RS("lname") & "</td><td>" & RS("fname") & "</td><td>"
response.write RS("tel") & "</td><td>" & RS("mobile") & "</td><td>" & RS("init") & "</td><td>"
response.write RS("dept") & "</tr></td>"
rs.movenext
x=x+1
loop
'response.write "<tr><td colspan=7>Total Records : " & x & "</table>"
rs.close
conn.close
set conn=nothing
end if
set conn = nothing
%>
<%end select%>
<head>
<LINK REL=STYLESHEET HREF=" TYPE="text/css">
<style>
a:hover{color:red}
</style>
<title>Image Page</title>
</head>
[/code]
The problem is the returned article gives this
Code:
<table width=550 border=0 align=left><th align=left>Last Name</th><th align=left>First Name</TH><th align=left>Tel</TH><th align=left>Mobile</TH><th align=left>Initials</TH><th align=left>Dept</TH><th align=left>Picture</TH><TR bgcolor=#DFEFFD><TD>Surname</td><td>FirstName</td><td>Extn</td><td></td><td>IHI</td><td>IT</tr></td><img Src=" & image & ></img></tr></td>
<head>
<LINK REL=STYLESHEET HREF="[URL unfurl="true"]http://urllocation/style/csog.css"[/URL] TYPE="text/css">
<style>
a:hover{color:red}
</style>
<title>Image Page</title>
</head>
displaying the red X of no image even if the image resides in the same folder as the database, I can worry about paths later I just want to get the image display working.
TIA