Home All Groups Group Topic Archive Search About

Displaying images from an Access Database



Author
7 Apr 2006 1:46 PM
kbrad
I have an Access database set up with a number of text fields and a hyperlink
field which references a different image per record. I am trying write ASP
code to retrieve allt his data and images onto a web page. I have the data
but  the images are causing a problem.
The code I am using is as follows:
For the data:
<TD><P><FONT COLOR="#000000"><% Response.Write rsRecordset("Fieldname")
%></FONT></TD>
This is fine.
For the images:
<TD><P><FONT COLOR="#000000"><img src=<% Response.Write
rsRecordset("ImageFieldName") %>> </FONT></TD>
With this I get the square with the little red cross in it.
I have managed to get the image to appear by hard coing the link I have in
one of my database fields but that isn't what I want.
Can anyone help?

Author
7 Apr 2006 2:59 PM
Mike Brind
kbrad wrote:

Show quote
> I have an Access database set up with a number of text fields and a hyperlink
> field which references a different image per record. I am trying write ASP
> code to retrieve allt his data and images onto a web page. I have the data
> but  the images are causing a problem.
> The code I am using is as follows:
> For the data:
> <TD><P><FONT COLOR="#000000"><% Response.Write rsRecordset("Fieldname")
> %></FONT></TD>
> This is fine.
> For the images:
> <TD><P><FONT COLOR="#000000"><img src=<% Response.Write
> rsRecordset("ImageFieldName") %>> </FONT></TD>
> With this I get the square with the little red cross in it.
> I have managed to get the image to appear by hard coing the link I have in
> one of my database fields but that isn't what I want.
> Can anyone help?

1. Do a View Source, and look at the results from
rsRecordset("ImageFieldName").  You might see the problem that way.
2. Right click on the redex and look at its properties.  That's another
way to track down the problem.

Let us know what you find.  If you can't resolve the problem, give us a
sample of the contents of rsRecordset("ImageFieldName")

--
Mike Brind
Author
7 Apr 2006 7:45 PM
kbrad
When I do View Source as suggested I see
<img src =#http://pcname/directory/imageName.jpg#>
Are the # signs causing a problem? If so how do I get rid of them?

When I hard code http://pcname/directory/imageName.jpg into the code I do
get the correct image so it does recognise the path.

When I right click the redex I see the file name with # at the end at the
top of the properties box ie. imageName.jpg#
Also the Address: is
http://pcname/directory/TMPi8f7xda7h.asp#http://pcname/directory/imageName.jpg#
Do you think this is right?


Show quote
"Mike Brind" wrote:

>
> kbrad wrote:
>
> > I have an Access database set up with a number of text fields and a hyperlink
> > field which references a different image per record. I am trying write ASP
> > code to retrieve allt his data and images onto a web page. I have the data
> > but  the images are causing a problem.
> > The code I am using is as follows:
> > For the data:
> > <TD><P><FONT COLOR="#000000"><% Response.Write rsRecordset("Fieldname")
> > %></FONT></TD>
> > This is fine.
> > For the images:
> > <TD><P><FONT COLOR="#000000"><img src=<% Response.Write
> > rsRecordset("ImageFieldName") %>> </FONT></TD>
> > With this I get the square with the little red cross in it.
> > I have managed to get the image to appear by hard coing the link I have in
> > one of my database fields but that isn't what I want.
> > Can anyone help?
>
> 1. Do a View Source, and look at the results from
> rsRecordset("ImageFieldName").  You might see the problem that way.
> 2. Right click on the redex and look at its properties.  That's another
> way to track down the problem.
>
> Let us know what you find.  If you can't resolve the problem, give us a
> sample of the contents of rsRecordset("ImageFieldName")
>
> --
> Mike Brind
>
>
Author
7 Apr 2006 8:17 PM
Mike Brind
No, it's not right.  I don't know where you are getting the hash/pound
marks from.  Have a look at your database table and see if they are
there.  If they are, then they must get there when you enter the data.


The best way to get rid of them is go into the raw data and delete
them, but if you can't, then you have to use replace() to get rid of
them:

<img src="<% = replace(rsRecordset("ImageFieldName"),"#","")%>">

Incidentally, you forgot to put " before and after the image filename.
That won't help either.

--
Mike Brind



kbrad wrote:
Show quote
> When I do View Source as suggested I see
> <img src =#http://pcname/directory/imageName.jpg#>
> Are the # signs causing a problem? If so how do I get rid of them?
>
> When I hard code http://pcname/directory/imageName.jpg into the code I do
> get the correct image so it does recognise the path.
>
> When I right click the redex I see the file name with # at the end at the
> top of the properties box ie. imageName.jpg#
> Also the Address: is
> http://pcname/directory/TMPi8f7xda7h.asp#http://pcname/directory/imageName.jpg#
> Do you think this is right?
>
>
> "Mike Brind" wrote:
>
> >
> > kbrad wrote:
> >
> > > I have an Access database set up with a number of text fields and a hyperlink
> > > field which references a different image per record. I am trying write ASP
> > > code to retrieve allt his data and images onto a web page. I have the data
> > > but  the images are causing a problem.
> > > The code I am using is as follows:
> > > For the data:
> > > <TD><P><FONT COLOR="#000000"><% Response.Write rsRecordset("Fieldname")
> > > %></FONT></TD>
> > > This is fine.
> > > For the images:
> > > <TD><P><FONT COLOR="#000000"><img src=<% Response.Write
> > > rsRecordset("ImageFieldName") %>> </FONT></TD>
> > > With this I get the square with the little red cross in it.
> > > I have managed to get the image to appear by hard coing the link I have in
> > > one of my database fields but that isn't what I want.
> > > Can anyone help?
> >
> > 1. Do a View Source, and look at the results from
> > rsRecordset("ImageFieldName").  You might see the problem that way.
> > 2. Right click on the redex and look at its properties.  That's another
> > way to track down the problem.
> >
> > Let us know what you find.  If you can't resolve the problem, give us a
> > sample of the contents of rsRecordset("ImageFieldName")
> >
> > --
> > Mike Brind
> >
> >
Author
7 Apr 2006 9:15 PM
Mike Brind
Incidentally, how are you getting the image file names into the
database?

--
Mike Brind



Mike Brind wrote:
Show quote
> No, it's not right.  I don't know where you are getting the hash/pound
> marks from.  Have a look at your database table and see if they are
> there.  If they are, then they must get there when you enter the data.
>
>
> The best way to get rid of them is go into the raw data and delete
> them, but if you can't, then you have to use replace() to get rid of
> them:
>
> <img src="<% = replace(rsRecordset("ImageFieldName"),"#","")%>">
>
> Incidentally, you forgot to put " before and after the image filename.
> That won't help either.
>
> --
> Mike Brind
>
>
>
> kbrad wrote:
> > When I do View Source as suggested I see
> > <img src =#http://pcname/directory/imageName.jpg#>
> > Are the # signs causing a problem? If so how do I get rid of them?
> >
> > When I hard code http://pcname/directory/imageName.jpg into the code I do
> > get the correct image so it does recognise the path.
> >
> > When I right click the redex I see the file name with # at the end at the
> > top of the properties box ie. imageName.jpg#
> > Also the Address: is
> > http://pcname/directory/TMPi8f7xda7h.asp#http://pcname/directory/imageName.jpg#
> > Do you think this is right?
> >
> >
> > "Mike Brind" wrote:
> >
> > >
> > > kbrad wrote:
> > >
> > > > I have an Access database set up with a number of text fields and a hyperlink
> > > > field which references a different image per record. I am trying write ASP
> > > > code to retrieve allt his data and images onto a web page. I have the data
> > > > but  the images are causing a problem.
> > > > The code I am using is as follows:
> > > > For the data:
> > > > <TD><P><FONT COLOR="#000000"><% Response.Write rsRecordset("Fieldname")
> > > > %></FONT></TD>
> > > > This is fine.
> > > > For the images:
> > > > <TD><P><FONT COLOR="#000000"><img src=<% Response.Write
> > > > rsRecordset("ImageFieldName") %>> </FONT></TD>
> > > > With this I get the square with the little red cross in it.
> > > > I have managed to get the image to appear by hard coing the link I have in
> > > > one of my database fields but that isn't what I want.
> > > > Can anyone help?
> > >
> > > 1. Do a View Source, and look at the results from
> > > rsRecordset("ImageFieldName").  You might see the problem that way.
> > > 2. Right click on the redex and look at its properties.  That's another
> > > way to track down the problem.
> > >
> > > Let us know what you find.  If you can't resolve the problem, give us a
> > > sample of the contents of rsRecordset("ImageFieldName")
> > >
> > > --
> > > Mike Brind
> > >
> > >
Author
8 Apr 2006 1:30 AM
Bob Lehmann
> I don't know where you are getting the hash/pound marks from.

He's probably using Access's hyperlink "data type". Possibly useful in
access, but completely useless anywhere else.

Bob Lehmann

Show quote
"Mike Brind" <paxton***@hotmail.com> wrote in message
news:1144441053.880224.162710@t31g2000cwb.googlegroups.com...
> No, it's not right.  I don't know where you are getting the hash/pound
> marks from.  Have a look at your database table and see if they are
> there.  If they are, then they must get there when you enter the data.
>
>
> The best way to get rid of them is go into the raw data and delete
> them, but if you can't, then you have to use replace() to get rid of
> them:
>
> <img src="<% = replace(rsRecordset("ImageFieldName"),"#","")%>">
>
> Incidentally, you forgot to put " before and after the image filename.
> That won't help either.
>
> --
> Mike Brind
>
>
>
> kbrad wrote:
> > When I do View Source as suggested I see
> > <img src =#http://pcname/directory/imageName.jpg#>
> > Are the # signs causing a problem? If so how do I get rid of them?
> >
> > When I hard code http://pcname/directory/imageName.jpg into the code I
do
> > get the correct image so it does recognise the path.
> >
> > When I right click the redex I see the file name with # at the end at
the
> > top of the properties box ie. imageName.jpg#
> > Also the Address: is
> >
http://pcname/directory/TMPi8f7xda7h.asp#http://pcname/directory/imageName.jpg#
Show quote
> > Do you think this is right?
> >
> >
> > "Mike Brind" wrote:
> >
> > >
> > > kbrad wrote:
> > >
> > > > I have an Access database set up with a number of text fields and a
hyperlink
> > > > field which references a different image per record. I am trying
write ASP
> > > > code to retrieve allt his data and images onto a web page. I have
the data
> > > > but  the images are causing a problem.
> > > > The code I am using is as follows:
> > > > For the data:
> > > > <TD><P><FONT COLOR="#000000"><% Response.Write
rsRecordset("Fieldname")
> > > > %></FONT></TD>
> > > > This is fine.
> > > > For the images:
> > > > <TD><P><FONT COLOR="#000000"><img src=<% Response.Write
> > > > rsRecordset("ImageFieldName") %>> </FONT></TD>
> > > > With this I get the square with the little red cross in it.
> > > > I have managed to get the image to appear by hard coing the link I
have in
> > > > one of my database fields but that isn't what I want.
> > > > Can anyone help?
> > >
> > > 1. Do a View Source, and look at the results from
> > > rsRecordset("ImageFieldName").  You might see the problem that way.
> > > 2. Right click on the redex and look at its properties.  That's
another
> > > way to track down the problem.
> > >
> > > Let us know what you find.  If you can't resolve the problem, give us
a
> > > sample of the contents of rsRecordset("ImageFieldName")
> > >
> > > --
> > > Mike Brind
> > >
> > >
>

AddThis Social Bookmark Button