ASP Question - Images ...

S

Suburbiana68

I am designing a website that is based from an Access database; in the
database I have a table called "Categories" with fields called "Category"
and "CategoryPic".
On my index page I have coding to get the list of Categories, called
rsCategories. What I am attempting to do is create ASP code that would
retrieve an associated GIF file from my images folder when a particular
"Category" is chosen (ie. if you choose CategoryA from the recordset, then
CategoryA.gif would appear on the page, CategoryB would retrieve
CategoryB.gif, etc.).

Can anyone kindly assist me in completing this one piece of code that is
driving me nuts?

Thanks in advance,
Craig
 
J

Jeff Clark

show us what you have so far,
but generally it is this:

<img src = "<%= rsCategories("CategoryPic") %>.gif" border=0 >

Notice that I beat "Ray at Home" at helping you out here.
 
J

JohnBon

Maybe you can do like this:

response.write "<img src='../imagefolder/"& rsCategories("Category") &".gif'>"



/Johnbon
 
S

Suburbiana68

Thanks Jeff and Jon, still don't seem to get any response, just errors ...
here is what I originally had:

<img src="/images/headergifs/<%=rsCategories.FieldValue("CategoryPic",
Container) %>" alt="Category Pic" width="79" height="79" border="0"
id="categoryPics" />

Which delivers the error:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''

from that line of code.

I'm still bamboozled, kind of new at the programming side of this ... again
thanks in advance for any assistance.
Craig
 
J

Jeff Clark

oh well did you do a set statement for the rsCategories?

set rsCategories = server.createobject("adodb.recordset")

also, maybe you have no records returned. did you test for that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,136
Messages
2,570,795
Members
47,346
Latest member
Jason Calder

Latest Threads

Top