473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Displaying images from an Access Database

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?

Apr 7 '06 #1
5 1755

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

Apr 7 '06 #2
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

Apr 7 '06 #3
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


Apr 7 '06 #4
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


Apr 7 '06 #5
> 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" <pa*******@hotmail.com> wrote in message
news:11**********************@t31g2000cwb.googlegr 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

Apr 8 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
1
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each...
8
by: Lloyd Sheen | last post by:
I have a list of JPG's which are found in a SQL Server database. When the page selects a certain piece of data it will refer to the file system (resident on IIS server with a virtual directory)...
10
by: gnewsgroup | last post by:
I've googled and tried various approaches, but could not resolve this problem. The article at MSDN: Displaying Images in a GridView Column only presents a simple case where all data (including the...
1
by: JVFord | last post by:
Hello. We were having trouble displaying our photos (inserted as OLE Objects) in our database using Access 2003. (you can think of it as a contacts database where it housed info on the person and...
4
by: redpears007 | last post by:
Hi Again, Throwing this one out to you again as i am not getting anywhere and can find little to no information out there. I am currently displaying images (Jpegs) in access via the routine...
14
by: ashraf02 | last post by:
i used a code from a website that allows you to display images. however everything works fine from storing the image to the database but it does not display the image. the following code is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.