Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2004, 05:22 PM
Authorized User
 
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nvillare
Default Create an image table using a loop

I am trying to create a table with images (thumbnails), 5 per row. I know there's a way to do this using a for loop, but I am not sure how to go about doing it.the images are all titled 1 through 20, and I want to put 5 images per row. I also would like to be able to click on it and produce a new page (on-the-fly) of the actual image size.

What is the best way to do this? Any suggestions would be great!

Thanks in advance!

Thanks!

nvillare
__________________
Thanks!

N
 
Old February 4th, 2004, 02:42 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use something like this, You might have to make necessary changes

<%
Dim dbConn 'Your Connection Object
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open strConnect ' Use your connection String

Dim Objrs
Set Objrs = Server.CreateObject("ADODB.Recordset")

Objrs.Open "Your SQL Statement",dbConn,1,3

IF NOT Objrs.EOF Then
   recCount = 0
    Do Until ObjRs.EOF
  IF recCount Mod 5 = 0 Then ' 5 Records per Row
      IF recCount <> 0 Then
%>
   </tr>
<% End IF %>
    <tr>
    <td width="40"><img src="<%= Objrs("thumbnail_image") %>" ></td>
     <% ELSE %>
    <td width="40"><img src="<%= Objrs("image") %>"></td>
<% End IF %>
<%
    recCount = recCount +1
    Objrs.MoveNext
    Loop

Objrs.Close
Set Objrs = Nothing
dbConn.Close
Set dbConn = Nothing
%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 07:49 AM
Loop problem in capturing image using webcam labby BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 0 January 5th, 2007 09:13 PM
create array for loop in FSO jfergy Classic ASP Professional 4 April 14th, 2006 09:59 PM
create string from For Each loop dhborchardt Classic ASP Databases 3 March 17th, 2004 01:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.