ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 12th, 2012, 04:45 AM
Pioneered Pioneered is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 4 Pioneered User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 44 sec
Reputation Power: 0
Call same image multiple times on one page

Hi again all,

I have come upon another problem which I am having trouble with.
I am used to php and am trying to get my head around asp.

I have a function which calls an image from my database however if I try to call that image more than once on the same page it does not show up, there is no error it is just not appearing.

In the code below I have [Image1] showing fine but in the sections where Image2 - Image5 are there is a blank box showing, if I click on the blank box it opens a pop-up displaying the actual image as intended.

If I change Image2 to read Image1 again only one instance of Image1 will be displayed.

Any help would be greatly appreciated.

The code in question is:

Code:
 
<%
Set MyCmd = Server.CreateObject("ADODB.Command")				MyCmd.ActiveConnection = MyConn
MyCmd.CommandText = "SELECT NewsID, Title, DateUploaded, Image1, Image2, Image3, Image4, Image5, Article FROM DB WHERE NewsID = ?"
							MyCmd.Parameters.Append MyCmd.CreateParameter("", 3, 1, , request("id"))
Set RSNews = Server.CreateObject("ADODB.RecordSet")
RSNews.Open MyCmd
Do While Not RSNews.EOF
%>
                            <h2><%=RSNews("Title")%></h2>
                              <img src="images/projects/<%=RSNews("Image1")%>" width="150" alt="" border="0" align="left" class="leftimg"/>
                            	<h2>Gallery</h2>
                                <p>Click an image below to view full size.</p>
                            <div id="portfoliobox">
                                    <a href="images/projects/<%=RSNews("Image2")%>" class="thickbox"><img src="images/projects/<%=RSNews("Image2")%>" width="110" border="0" alt="" align="left" class="leftimg" /></a>
                                    <a href="images/projects/<%=RSNews("Image3")%>" class="thickbox"><img src="images/projects/<%=RSNews("Image3")%>" width="110" border="0" alt="" align="left" class="leftimg" /></a>
                                    <a href="images/projects/<%=RSNews("Image4")%>" class="thickbox"><img src="images/projects/<%=RSNews("Image4")%>" width="110" border="0" alt="" align="left" class="leftimg" /></a>
                                    <a href="images/projects/<%=RSNews("Image5")%>" class="thickbox"><img src="images/projects/<%=RSNews("Image5")%>" width="110" border="0" alt="" align="left" class="leftimg" /></a>
</div>
							<p><%=RSNews("Article")%></p>

 

Reply With Quote
  #2  
Old January 13th, 2012, 02:05 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 18th Plane (13500 - 13999 posts)
 
Join Date: Jun 2003
Posts: 13,894 Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 4 Days 15 h 10 m 20 sec
Reputation Power: 4227
If your code has any "on error resume next" statement remove it so errors don't get supressed.

Copy the image blob to a local variable or file, ADO sometimes only allows a single code reference to a blob field.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old January 13th, 2012, 02:33 AM
Pioneered Pioneered is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 4 Pioneered User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 44 sec
Reputation Power: 0
Quote:
Originally Posted by Doug G
If your code has any "on error resume next" statement remove it so errors don't get supressed.

Copy the image blob to a local variable or file, ADO sometimes only allows a single code reference to a blob field.


Hi Doug,

Once again thankyou for responding to my questions,
I have removed any instances of "on error resume next" but am still getting the same problem, I failed to mention in my previous post that the old server was running ii6 the new server is running ii7.5 I have enabled classic asp and my other forms and scripts work, I do not know if that holds any clues to this puzzle, but information is key.

As i said before I am new to asp, are you able to give me an example please on "Copy the image blob to a local variable or file, ADO sometimes only allows a single code reference to a blob field."

Reply With Quote
  #4  
Old January 13th, 2012, 09:12 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 18th Plane (13500 - 13999 posts)
 
Join Date: Jun 2003
Posts: 13,894 Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level)Doug G User rank is General 49th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 4 Days 15 h 10 m 20 sec
Reputation Power: 4227
I didn't look closely enough, it looks like you're only storing the path to the images in the db.

It's possible to store the actual image binary in a db as a "BLOB" field (Binary Large Object). ADO is Microsoft ActiveX Data Objects, which is the subsystem you're using to query the database and get a recordset. If you retrieve a BLOB field in a recordset, sometimes your asp code will only be allowed to refer to rs("blobfield") only one time, the blob data goes away after the 1st time it's read from the recordset.

But that's not your problem it seems.

First I'd use a database query tool to verify the correct data is stored in the database columns, and also verify the paths to the images are valid on your new server.

Reply With Quote
  #5  
Old January 17th, 2012, 04:22 AM
Pioneered Pioneered is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 4 Pioneered User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 44 sec
Reputation Power: 0
Hi Doug,

Thankyou for your helpfull advice once again, I have managed to resolve the issue to some extent but I think it is time to forget the old code now and either rebuild the site using PHP or asp.net.

Once again thankyou for taking the time to assist me

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Call same image multiple times on one page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap