updating multiple records at a time: loops

Results 1 to 3 of 3

Thread: updating multiple records at a time: loops

  1. #1
    Jeetah Guest

    Default updating multiple records at a time: loops

    I am trying to update multiple records at a time. I have a form with several tables, each table represents a record. The tables are pulled out of a database using a While not rs.eof statement. On the next page I attempt to update the records. I have a counter that counts each record on the previous page and pass this value on to the next page. I then say (I am trying to use the 4guys example on using forms to do batch database updates) for iloop = 0 to icount(icount being the counter from the previous page)...then i pull out the form values using requests and write the sql to update the database. I am getting the correct number of UPDATE statements, the problem is, each record contains all the records. For example, if a record contains the name "jack" and another record contains the name "jill", the update writes the name as "jack, jill". I know that there is a problem with my loop, and I know this is a very long question, but if anyone has an example or knows any other articles I could look at regarding multiple updates...I&#039m close to having this work, but not close enough. Thanks in advance.

  2. #2
    Michal M Guest

    Default RE: updating multiple records at a time: loops

    Hi Jeetah,<BR>Are you referring to this article?<BR>http://www.4guysfromrolla.com/webtech/100199-2.2.shtml<BR>If so, you should not have this problem because both the field identifying the record to be updated and the field containing the new value have unique names. <BR>It sounds to me like in your case, the field containing the new value repeats in the form with the same name. You should have a scheme that allows you to match id with value.<BR>Hope this will help ,<BR>Michal

  3. #3
    Jeetah Guest

    Default RE: updating multiple records at a time: loops

    Michal,<BR>When you say unique names, do you mean that i need to put the counter in for the variables?<BR><BR>ie. <BR>&#060;input type="text" name="textbox" value=""textbox" & icount"&#062;<BR><BR>on page 2:<BR>strtextbox = request.form(iloop & "textbox")<BR>...assuming that iloop and icount are set to 0 and are declared and passed properly...????

Posting Permissions

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