473,406 Members | 2,710 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,406 software developers and data experts.

Filling out the missing squares in my picture grid - HELP

Hi All

I know the subject sounds strange, but please bear with me.

Using ADO/ASP, I want to retrieve a list of pics from my db (which will be
dynamic number of pics as a user will be uploading anything from 1 to 12
pics) and put them in a grid (table) of say 3 x 4 cells.

I think this is easy to do if the user has uploaded 12 pics, as the
recordset's recursive loop will create the table for me, but my problem is
that what if they only upload 4, 5 or 7. How do I list these pics in my
grid, but get the ASP to neatly finish off the 3 x 4 grid? If I just leave
it to my recordset of say 7 recs then my 3 x 4 table is going to disjointed
and unfinished.

I hope this makes sense and hope you know of a way round it.

Many thanks.

Rgds

Laphan


Jul 22 '05 #1
2 1256
If Not rs.EOF Then
intCellMax = 3 ' Set to Column width you prefer
intCellCount = 0
With Response
.Write "<TABLE><TR>"
Do While Not rs.EOF
If intCellCount = intCellMax Then
.Write "</TR><TR>"
intCellCount = 0
End If
intCellCount = intCellCount + 1
.Write "<TD>"
.Write rs("WhatEver")
.Write "</TD>"
rs.MoveNext
Loop
If intCellCount < intCellMax And intCellCount > 0 Then
For i = (intCellCount + 1) To intCellMax
.Write "<TD>&nbsp;</TD>"
Next
End If
.Write "</TR></TABLE>"
End With
End If

'dlbjr
'Pleading sagacious indoctrination!
Jul 22 '05 #2
Many thanks dlbjr

I'll give it a go.

Rgds

Laphan
dlbjr <oo**@iforgot.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
If Not rs.EOF Then
intCellMax = 3 ' Set to Column width you prefer
intCellCount = 0
With Response
.Write "<TABLE><TR>"
Do While Not rs.EOF
If intCellCount = intCellMax Then
.Write "</TR><TR>"
intCellCount = 0
End If
intCellCount = intCellCount + 1
.Write "<TD>"
.Write rs("WhatEver")
.Write "</TD>"
rs.MoveNext
Loop
If intCellCount < intCellMax And intCellCount > 0 Then
For i = (intCellCount + 1) To intCellMax
.Write "<TD>&nbsp;</TD>"
Next
End If
.Write "</TR></TABLE>"
End With
End If

'dlbjr
'Pleading sagacious indoctrination!


Jul 22 '05 #3

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

Similar topics

6
by: binger | last post by:
Okay, Superbowl is only a few days away, but I thought it would be cool to set up an online registration for a football squares pool. My thoughts are to have people go into anywhere on the 10x10...
0
by: Jennifer | last post by:
I'm trying to fill a datagrid on a VB ASP web page. No data is showing up on my grid and I'm not sure why. The code is as follows Dim dvMain As DataView Dim X As Int16 Dim dtMain As New...
9
by: totalgeekdom | last post by:
Background: The problem I'm trying to solve is. There is a 5x5 grid. You need to fit 5 queens on the board such that when placed there are three spots left that are not threatened by the queen. ...
3
by: Jive Dadson | last post by:
Hello folks. I know precisely zero about image processing. I want to draw a grid of lines one or two pixels wide on a picture (.jpg, .png, or whatever). I figure this is probably a very easy...
1
by: WayneM | last post by:
I have compact framework app that I was trying to test out on a windows form, but I cannot get past the very first step of simply filling a DataGrid from a DataSet. My code is Dim sqlStmt As...
1
by: zafar | last post by:
hi every one, In my database picture is saved, i am using sql server 2000 and VB.net 2005. When I search the record, I need that the picture should also be shown in the grid ( i am using ultra grid...
10
by: wazzup | last post by:
C++ is new to me and I'm trying solve this problem but get stuck. Please help me out. Below is the task and after that is what i got so far. Create a program to print nested squares Input:...
5
by: coolminded | last post by:
hi everyone i have a problem, i just export the data from data grid to the word file, but now the problem is i want to insert the picture in the word with the path name in the grid. for ex; i...
3
by: Screaming Eagles 101 | last post by:
Hi, is there an easy way to add a picture(box) to a column in a datagridview ? My first column has a code, ex. 1, 2 or 3 According to these codes I'dd like to add a picture(box) to my second...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.