Reading and displaying images from an access database in dreamweaver mx using Coldfusion mx

Posted on 2005-03-30
Medium Priority
Last Modified: 2013-12-24
I have an access database with about 400 images, these images are all stored in 1 folder call images in the root folder. with the code I have all the images are appearing on the same page, how do you make them appear one by one?
heres my code.....

<CFQUERY NAME="sel_image" DATASOURCE="databaseproject.mdb">  
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<CFOUTPUT QUERY="sel_image">  
<IMG SRC="images/#image#"><BR></CFOUTPUT>
Question by:clonmelog
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

kkhipple earned 1500 total points
ID: 13663374
have a look at your earlier question that was posted:

LVL 35

Expert Comment

ID: 13663391
You have to do some sort of paging.  The code below shows 10 images per page.  If you want one per page then change the rowsperpage.

Put this at the top of the page
<!--- ------------------------------- --->
<cfquery NAME="sel_image" DATASOURCE="databaseproject.mdb">

<!--- Set up defaults so we can display results in Next-N interface --->
     <cfparam name="URL.StartRow" type="numeric" default="1">
     <cfparam name="URL.ShowAll" type="boolean" default="No">
     <cfset TotalRows = GetItems.RecordCount>
     <cfif URL.ShowAll>
          <cfset RowsPerPage = TotalRows>
          <cfset RowsPerPage = 10>
     <cfset EndRow = Min(StartRow + RowsPerPage - 1, TotalRows)>
     <!--- Set up the start row for next and back buttons --->
     <cfset NextStart = EndRow + 1>
     <cfset BackStart = StartRow - RowsPerPage>
<!--- ------------------------------- --->

Put this in the page where you want to display the records
<!--- ------------------------------- --->
<cfloop query="sel_image" startrow="#StartRow#" endrow="#EndRow#">
<!--- code to display each record goes here --->
<IMG SRC="images/#image#"><br>
<!--- ------------------------------- --->

Put this at the bottom of the page
<!--- ------------------------------- --->
<cfset Pagenum = 1>
<cfif TotalRows GT 0>Page</cfif>
<cfloop index="Row" from="1" to="#TotalRows#" step="#RowsPerPage#">
     <!--- If Pagenum is current page then show without link --->
     <cfif Row EQ StartRow>
          <a href="Display.cfm?CatID=#CatID#&StartRow=#Row#">#Pagenum#</a>
     <cfset Pagenum = Pagenum + 1>
Displaying <b><cfif TotalRows GT 0>#StartRow#<cfelse>0</cfif></b> to <b>#EndRow#</b> of <b>#TotalRows#</b> Items
<!--- ------------------------------- --->

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question