Loop query

Results 1 to 2 of 2

Thread: Loop query

  1. #1
    Join Date
    Dec 1969

    Default Loop query

    I also posted this in the database Q&A, don&#039;t be mad...<BR><BR>I have a table that I&#039;d like to update that has these fields (pollOption_id, poll_id, optionText, optionIndex) I&#039;m trying to update multiple records coming from a form dynamically. I haven&#039;t tried this yet but I want to know if this is common, an acceptable practise or maybe some has a better way of doing this. <BR><BR>&#060;%<BR>var options = new Array(); <BR>var pollID = Request.Form("pollID"); <BR>var question_num = Request.Form("questions_num"); // number of options <BR>for(var i=1; i&#060;=question_num;i++) <BR>{ <BR> options[i] = Request.Form("option" + i); <BR>} <BR>for(var i=1; i&#060;=question_num;i++) <BR>{ <BR> var rsSQL = "UPDATE lv_pollOptions SET " <BR> + "optionText=&#039;" + options[i] + "&#039;" <BR> + " WHERE poll_id="+ pollID <BR> + " AND pollOption_id=" + i; <BR> rsData = objConn.Execute(rsSQL, ,adCmdText); <BR>} <BR>%&#062;<BR><BR>Can I loop through a query like this? <BR><BR>Chris

  2. #2
    Join Date
    Dec 1969

    Default Answered in DB forum

    Thanks for saying you posted it both places. Most people don&#039;t bother.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts