473,668 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a correctly formatted table from a GetRows array

Hi All

Somebody kindly sent me a routine to do this sometime ago, but for the life
of me I can't work out how it works and would prefer to use a simpler method
so that I can resolve any future issues with it.

Basically I have an array populated from a recordset getrows and I want to
create a nicely formatted table of this data with all of the right columns.

If my array consists of 8 rows of data and I want my table to display this
array 3 columns wide then the routine needs to make sure that it drops the
array rows onto enough table rows to show them all, eg:

< data1 > < data1 > < data1 >
< data1 > < data1 > < data1 >
< data1 > < data1 > < create the <TD></TD> bit but obviously leave it
blank >

Any help you can give would be very much appreciated.

The code I currently use, but don't understand is as follows:

Response.Write "<TABLE CELLSPACING=0 CELLPADDING=0 CLASS='ProdFull Desc'
BORDER=0>"

intArrayCount = UBound(arrSQLDa ta,2)
intStartRow = 1

IF intArrayCount mod 3 = 0 THEN
intColDiff = CInt(intArrayCo unt \ 3)
ELSE
intColDiff = CInt(intArrayCo unt \ 3) + 1
END IF

FOR x = 1 TO intColDiff
Response.Write "<TR>"
intTargetRow = intStartRow
z=0

FOR y = 0 to intArrayCount
IF y = intTargetRow-1 THEN
Response.Write "<TD ALIGN='CENTER'> <IMG SRC='"
Response.Write cImageGalleryFo lderPath & arrSQLData(0,y) & "'
BORDER=0><BR>"
Response.Write arrSQLData(1,y) & "</TD>"
intTargetRow = intTargetRow + intColDiff
END IF
NEXT

Response.Write "</TR><TR><TD COLSPAN=" & intColDiff & "
HEIGHT=10></TD></TR>"
intStartRow = intStartRow + 1
NEXT

Response.Write "</TABLE><BR>"

Nov 29 '05 #1
0 1174

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

Similar topics

5
8171
by: Croney69 | last post by:
I am getting information out of a table to place into to an Array. rs=DataConn.Execute(strSQL) At this point I place it into the array objArray=rs.GetRows() But how do I handle things if the rs came back blank?
8
2475
by: Moshe | last post by:
I'm facing an odd behavior in using the GetRows Method. I'm not sure what's causing it because it has been working fine until now. I have a sproc that returns 1 row. I display the RS info on the page using a DO-WHILE loop. All fields have values. I then rerun the same sproc, but this time extract the values into an array using getrows. I loop through the array and display the content of each element on screen. However, from the 14...
11
5022
by: Crane Linkledder | last post by:
What is the difference, and when to use one over the other? Thanks
11
3512
by: Laphan | last post by:
Hi All I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as possible. My problem is that I can't seem to use this to complete good effect because the IsArray statement doesn't seem to work with a local var array that has or has not been populated with the .getRows() property.
10
26300
by: Hank | last post by:
Hello, I'm having trouble reading from a table directly into an array using Access 2000. Dim db As Database Dim rsTime As Recordset Dim TimeArray As Variant Set db = CurrentDb Set rsTime = db.OpenRecordset("Time Record")
2
3412
by: Daz | last post by:
Hi everyone. I am having a problem with array_search(). My php script gets a list of books from the database, and then compares them with a list of books which have been obtained from a textarea in a form, and formatted into single books, each one stored in a non-associative array. I have a function that compares the books in the $user_books array, to those in the array derived from the books that are in the database. If a book exists...
4
4322
by: cbtechlists | last post by:
I have an ASP app that we've moved from a Windows 2000 to a Windows 2003 server (sql server 2000 to sql server 2005). The job runs fine on the old servers. Part of the app takes a recordset and response.writes out comma delimited strings so that the results are opened in Excel or saved to a flat file. Basically, it looks something like this like this:
5
13862
by: =?Utf-8?B?bWNhdWxpZmZl?= | last post by:
I have an old application ( pre-VB5) that I need to add a select/option list to. This is an edit program so the values for the form will be retrieved from a database. How do I set the value of the dropdown with the value from the database. The value in the database is either new, trial, maint., employee, beta, or null. I need to set the dropdrown to one of these values. An example of the select; <td> <select name="ordReason">...
11
7568
AutumnsDecay
by: AutumnsDecay | last post by:
Hey everyone. I have been writing a testimonials backend for a client who wishes to use the feature. How it is supposed to work is like this: The user writes a testimonial of their experience at the salon into a basic HTML form. When the user clicks send it runs a PHP script inserting it into a MySQL table. The table has 4 fields: id, msg, name, active When the testimonial is submitted it obtains a default value of 0 for the...
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8575
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.