Looping Thorough A Table To Get Code List
Assume there is a table called Item:
and fields Itemcode Customercode
now a customer may have one or many items(itemcode)
Now the issues are, Customercode can be zero or a code value.
NOw i want to put a do while loop to get all the records as comma seperated format
TempItemcodest=0
select * from Itemtable where customercode=customervalue
Do while not Rs.eof
TempItemcodest=TempItemcodest & "," & rs.fields("Itemcode")
rs.movenext
loop
TempItemcodest=TempItemcodest & "0"
so i am adding a zero at the begging and end to have the commas seperated properly.
is there any better way to do this?
View Replies
ADVERTISEMENT
I have this form..which has a table (created from stored procedure
values)..once the table is populated..i have some radio buttons (for
each row of the table) and a main submit button.
On clicking submit..i want to loop through the table..pick up the
first <TDbeing the user ID and the value of the radio button clicked
(currently I have my radio button ID set as UserID_0, UserID_1 ..
etc). And pass those into a stored procedure..
View Replies
View Related
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
I already know how to create a drop down list that reads from a database. However, how can i make a drop down list that reads from a table but it automatically selects a specific row instead of the first row?
View Replies
View Related
I have drop-down list with product categories and next to it I've got a table with list of products. I've managed to make them to read the data from the data base. In drop-down list i have names of 6 categories and in the table i have names of all my products I've got in the data Base, but i couldn't make the table showing only those products depending on which category name has been selected in the drop-down list.
View Replies
View Related
I use while-loop the show the table content in web page. e.g (bookingno,
booking date,customer no)
However, the client need me insert one column (confirmdate ) and allow the
user input and update the date .
View Replies
View Related
I currently have a set of documents in a directory that i need to list in a html table. Is there any way to generate the table with the documents listed instead of having to update the table manually everytime a new document is added to the list.
View Replies
View Related
Anyone have any advice on getting a recordset of all tablenames in a database? I have an access database that I am constantly adding tables to.
I want to have code that will lookup all tables and populate a selectbox with the tablenames so that I can click to look at each table individually.
View Replies
View Related
I would like to know if it is possible to fill in an access table through a select list inside an APS 3 web page. If yes, how ?
View Replies
View Related
I'm creating an online shop which has an area showing the top ten best selling products. I'd like to generate the list of the best selling products from my OrdersDetail table (which is table showing listing purchases made on the site), ordered by the most popular at the top and the least popular at the bottom.
I thought if I could use the SQL DISTINCT command this would create a list of products without duplicates, then if I could COUNT them I'd generate a list of the most popular products in the OrdersDetails table. This nearly works but the list won't ORDER BY the COUNT column (I get an error). This is my code so far:
SELECT DISTINCT ProductDescription, COUNT(ProductDescription) AS bestSellers
FROM OrdersDetail
GROUP BY ProductDescription
View Replies
View Related
I have a sql server 2000 table with a comma delimited list of ids. there is a seperate lookup table with a desc for each id.
I need for this data to be retuned in the same order in which the data was entered into the database. right now it is returning ordered by the id from the lutable.
View Replies
View Related
I would like to send the same email to every email address that I have in a table.Only complication is that some records have an email address and some don't (some people dont have email addresses.
I had a go and made an array and used the len(email)>0 idea, so that if no email address, skip sending and email. Guess just after some standard code, nothing fancy. The site is on a commercial server running win 2000 .
View Replies
View Related
I have an .asp page that contains a drop down menu, that when a selection is made, reformats the page to one of 22 different .asp pages. When clicked, the drop-down disappears and the options from it are formatted as a list on the left hand side of the page.
I need to format this so the list is in 3 columns, with the secection bold. I think I need about 4 if..then statements, but I've never done this before...here's the specific code, the code for the drop-down is first, then the code for the "quick link" list: Code:
View Replies
View Related
I am trying to plot the days off employees have taken in the selected month visually using the following code. The code below takes a long time to execute typically about 8-15 secs each time. Code:
View Replies
View Related
How can i list out all the email address into my website from the hotmail caontact list? i am successful log in into the yahoo contact list by using serverxmlhttp and list out all the email address from the page source, but i could not access to hotmail by using the serverxmlhttp. Is any other methos can list out the email address from hotmail contact list?
View Replies
View Related
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
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
Is it possable to exit a loop in asp.
View Replies
View Related
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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