Recordset Looping - Tables

I know how to loop around a recordset and put it into a table :

ASP Code:
<table border="1">
    <tr>
    <td>ID</td>
    <td>Answer</td>
    </tr>
    <%Do while Not answerRecordset.eof%>
            <tr align="center">
        <td><%=answerRecordset("entryName")%></td>
             </tr>
    <%  answerRecordset.MoveNext
    Loop%>
</table>

But how would i loop around but instead of one massive column put the answers into 4 diferent columns

View Replies


ADVERTISEMENT

Looping Through A Recordset

I have a recordset which writes out a table. As it is constructed now it loops through and repeats every record, but i want the last two rows to only appear once, but when I try to move the rsProd.MoveNext to where I want the loop to stop I get an error msg saying:

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. Code:

View Replies View Related

Looping Through Recordset

I would like to split a recordset into two parts.
For example, in a left hand column I would to display upto the first 10 records and in the right hand column the next 10 records etc.
I would like this to work even if there are only 3/4 records in total (ie. Less than 10) - so the page would display the first 3/4 records in the left hand column and nothing in the right.
I would like to do this without the use of paging if poss as it needs to be pretty simple!

View Replies View Related

Code For Looping Through Recordset

I am able to get the totals across as per the code below. I need to toal each column now.

fieldsnum = rsDetail.Fields.Count - 1
Response.write("<td><font color='#003366' size='1' face='Verdana'>")
total = 0
For i = 5 to fieldsnum
subtotal = rsDetail(i).value
if IsNull(subtotal) Then subtotal = 0
total = total + subtotal
Next
Response.write(total)
Response.write("</td>")
rsDetail.MoveNext
Loop
Response.write("</tr></table></td></tr></table>")
rsDetail.Close
End If

View Replies View Related

2 Tables In One Recordset

I have been trying to create a set of horse race results.The result of the race is one table and the breeding and owner details in the other table.I am using the horse name as the comon value in each table.the tables look something like this

table: result
pos1; horse name
pos2; horse name
etc.

table: names
horse name; horsename, sire; sire, dam; dam
horse name; horsename, sire; sire, dam; dam

Currently I am using a new record set for EVERY field position sorted by the horse name to bring up the related breeding for every positoin in the race field.
This mean for some races I am calling 16 seperate record sets.

View Replies View Related

Recordset With Joined Tables

Does anyone know a good way of searching a recordset with joined tables and grouping the records (it's a one to many relationship) so that the fields belonging to the table with the primary key are only shown once?

So for example if I have a companies table and and offices table where a company can have multiple offices and I use a linked table to join the two. I need to be able to search both the company and office tables and I want my ASP to display: Code:

View Replies View Related

Creating A Recordset That Joins 3 Tables

I would like to create a recordset which joins 3 tables using the column 'productid' as the key column throughout. I want all the columns from all three tables with a where clause that says category = beau and subcategory = mirror. I have tried numerous things but I get one error message after another. Code:

View Replies View Related

Create A Recordset With Multiple Tables?

My database has customers, orders, and orderDetails tables. I'm trying to create a page that we can access to lookup all details about our orders. That page will need information from all of these tables.

How do I create a recordset that can handle the relationships and bring in all data?

View Replies View Related

Clone/duplicate Recordset Spanning Multiple Tables

I would like to dulicate a selected record. Sounds easy enough like performing another INSERT operation. However, that solution only works if the datasource is only one table.

I have 4 different tables all linked to the main table through a unique primary key (auto number). When a user clicks a button to clone a record, all related records from the other tables must also be duplicated using the newly assigned ID that matches the one from the main table.

Hopefully I didn't confuse you. Consider it like a multi-step process of filling out different web-based forms but using the same unique id.

I don't know the first place to start on creating duplicate entries based on existing records. If you can start me with the code, I could probably follow the logic. THe difficult part for me to conceptualize is how to carry this new ID to all the other tables.

View Replies View Related

Joining Three Tables Returns Unnecessary Fields In Recordset

I have three tables in my db, joined together. The connection works fine, but I want to stop the first two tables from listing their info. for each call to the third table.

ex:
table 1 - page title, description
table 2- section title, description
table 3 - links, and their info.

For each page, there are mulitple sections and links, so I don't want the section title to appear each time I display a new link.

Here is my code:

View Replies View Related

Creating Dynamic Tables In Dreamweaver To Display Tables

I know how to create dynamic tables in dreamweaver to display fields and records in a table of a database, but in my case I need to create a dynamic table that lists all the tables in the database, then to click on the one i want 2 edit the data in there.

View Replies View Related

ASP Looping

I have a database with many fields. One of this field is of type memo
which contains some bullet points seperated by # sign (something along
those lines). What I have is this code which gives me a table with one
row and as many columns in the split array. Code:

View Replies View Related

Looping With Asp

I am trying to loop through my database to display a picture. That is no problem. Where I hit a snag is this. I only want three pictures then break to a new row and three more, etc. Any ideas? What this does is display one record. Code:

View Replies View Related

Looping

Is it possable to exit a loop in asp.

View Replies View Related

Looping

i got a problem regarding abt several looping running at the same time. I wanted the 1st loop to run once and then the 2nd loop to start running after the 1st loop ran once.. but the coding I do doesn't seem to be able to do that. Can sum1 teach mi how to do it?
The coding:

View Replies View Related

Looping In ASP

I am working on an asp page that goes to a rs to get data. I need to run a loop that pulls the data line by line until it is at the end of the database. I could do an Until loop, but I don't know how many records are in the recordset. So I suppose it should be a do until end-of-file?

View Replies View Related

Looping In ASP

In my arrary ListSong(), I have song names like (Song1.mp3,Song2.mp3,Song3.mp3,.....).

If the user selects more than one song, it should play one after the other. I want to do some looping for the <embed> tag. Here is my code:

<EMBED SRC="Songs/<%=ListSong(0)%>.mp3" VOLUME="50" AUTOSTART="true" HEIGHT="80" WIDTH="415">

View Replies View Related

SQL Looping

is there anyway to do a loop with an sql command in? Ive created a message board type of thing but its got the option to delete unwanted messages. next to each message there is a lil checkbox with the Record ID for the message as the name tag, what im trying to do is when a user clicks say 3 messages to remove it puts the id's of the checkbox's clicked into a query string or something and then loops deleting the messages in the database.sorta works like this

Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("databases/conkers.mdb")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
messages = request.QueryString("ids")
for each value in messages do
mySQL = "DELETE FROM messages WHERE ID = '" &messages & "'"
Set RS = myConn.Execute(mySQL)
loop

View Replies View Related

Looping Through Folder

I have a folder with about 40 swf training movies.
I want to loop through the folder and display the titles of the movies and make them links.I just need help getting pointed in the right direction to make this happen.

View Replies View Related

Looping Issues

I've got an Array that has split a text field in an Access DB. This Array is now: Array(0) = 1 and Array(1) = 3.

I have another field in another table that has a number and then the name associated with that number.I am wanting to display the name associated with 1 and 3 from my DB but a Do Loop isn't working. I presume because after it displays Array(0) (which it does well) the Looping condition is no longer true because there is no "2" in my array, it skips to 3. So Array(0) works because its true, but then it stops because there is no two but does not pick back up with Array(1).

View Replies View Related

Looping Through Database

I am working on creating reports from an access database. I am trying to populate a table created from the one-to-many relationships in the database. In one column a name appears more than once because it is related to multiple records.

When I display this information I would like to only show the name once in one column but show all of the records it is related to in another.

I have attached a spreadsheet the better explains what I am trying to do. The report is written asp and I have been using loops to write the data to the report. I have also attached the code I am using. The report uses values that the user selects from a map. Then it selects the same values in the database.

View Replies View Related

Looping Thru Array

I need to look at each element in an array to write it to the web page, one element at a time. The previous page contained a form of dynamically created checkbox sets. The number of checkbox sets will always be unknown. Anyway, here's my question:

I've tried different code (due to circumstances that would be to lengthy to get into here, I need to use vbscript, be able to use javascript within vbscript code.

Here are examples I've tried and the results: Code:

View Replies View Related

Looping Insert

I'm currently having some major problems with an insert form that I created
Basically, if a large amount of information is being inserted into the database I get an error
This seems to be a restriction imposed by the host
What I would ideally like to be able to do is to grab so many characters from the textarea insert this into the database and loop this until everything has been inserted (the information would all need to be inserted into the same field of a record)
I've never tried this before so would appreciate any advice/tips on how to go about doing this

View Replies View Related

Looping Problem

I am trying to play multiple songs (as per the user selection) by using <embed> tag.
What is the loop condition I need to use to play the songs one by one. Ex:

<%
ListSong = (Song1.mp3,Song2.mp3) //(Array values differs)
For i = 0 to Ubound(ListSong)
<EMBED SRC="Songs/<%=ListSong(i)%>.mp3" VOLUME="50" AUTOSTART="true" HEIGHT="80" WIDTH="415">
Next
%>

But here the problem is: it's playing the last song in the array. But I need to play first Song1.mp3 and then Song2.mp3

View Replies View Related

ASP Looping Adding

i have a variable in a database that is looping that outputs numbers like:

1. 45
2. 34
3. 94
4. 34

But are all in the same variable:

DoDateTime((rsBoxEdit.Fields.Item("").Value), 3, 2057)

How can i make it so that it loops that variable and adds the numbers up and outputs 1 variable called total or something?

View Replies View Related

Problem With Looping

Im using the code below to create a calendar. The problem is when it comes to checking how many bookings have been taking on that day and colors it accordingly it doesnt go past the first day.

So say I have a booking on 1/1/2004 it will color it accordingly but wont color any of the rest of the days that have them on as well. Code:

View Replies View Related

Looping Checkboxes

I want somethingh like hotmail, where I don't know the exact amount of records displayed, but when the users checks the boxes and presses submit I can detect which boxes were checked and be able to perform the operation.

View Replies View Related

Looping Through Columns

Normally I do a query, and loop through the records. Is there a way to loop through the columns of each record?

View Replies View Related

Looping Variable

I have a variable that goes through a loop, and each time it appends the new value to the end using a comma. Example:

1st time through:
a = 1
2nd time through:
a = 1, 4
3rd time through:
a = 1, 4, 2

So now after my loop is all done I have this value where each value is seperated by a comma. What I want to do is compare each of the values and display only the largest number. Any ideas on how to do this?

View Replies View Related

Looping Problems

I'm have some trouble looping to the end of all the items that i split apart by a comma....mainly just displaying all the items in the string. Code:

set RS2Name001 = MyConn.Execute ("Select * from tblCustomers where UserName = '" & Request.Cookies("User")("strUserName") & "'")
rs22 = Split(RS2Name001("RS2Name"), ",")
bbb = RS2Name001("RS2Name")
For Each bbb in rs22
Response.Write rs22(x)
Response.Write "<br>"
next
Response.End

View Replies View Related

Jscript Looping

i have a jscript that accepts parameters/arguments, how do you loop thru the arguments?

i = 0;

while (!i == oArgs.length ) {
WScript.Echo[oArgs(i)];
i = i + 1;
}

this does not even get inside the loop.

View Replies View Related

Looping Through Directories

i have a subdomain on my works server that i use to store different stuff on, like different projects that i'm working on. They are all set up in their own folders, for example, sub.blah.com/project1, sub.blah.com/project2 etc etc. (all the folders have different names).

What i want to do is to create an index page on sub.blah.com that will list out all of the folders. I dont have any access to the server workings so this all has to be done with a script.

View Replies View Related

Looping Request

I have this request object and I put it in a loop but I receive an error using this, I didn't even know if I did it right

Quote: q_1=request("q_1")
q_2=request("q_2")

for i = 1 to 2

q_& i = request(q_& i) <<----syntax error

response.write q_& i
next

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved