Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Displaying images from an Access Database

Reply
Thread Tools

Displaying images from an Access Database

 
 
kbrad
Guest
Posts: n/a
 
      04-07-2006
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?



 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      04-07-2006

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

 
Reply With Quote
 
 
 
 
kbrad
Guest
Posts: n/a
 
      04-07-2006
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...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
>
>

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      04-07-2006
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...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
> >
> >


 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      04-07-2006
Incidentally, how are you getting the image file names into the
database?

--
Mike Brind



Mike Brind wrote:
> 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...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
> > >
> > >


 
Reply With Quote
 
Bob Lehmann
Guest
Posts: n/a
 
      04-08-2006
> 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

"Mike Brind" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.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...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
> > >
> > >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Displaying images in a repeater from database marvin@thos.ca ASP .Net 2 07-11-2005 02:14 PM
Displaying images from a database in an image control =?Utf-8?B?SmltIE1hY2U=?= ASP .Net 2 05-05-2004 04:26 AM
Displaying images from a MySQL Database Matt ASP .Net 0 08-01-2003 10:25 AM



Advertisments