Add Multiple Records From One ASP Page

Results 1 to 2 of 2

Thread: Add Multiple Records From One ASP Page

  1. #1
    Join Date
    Dec 1969

    Default Add Multiple Records From One ASP Page

    Hi,<BR><BR>I currently call a recordset from a database for a particular person, when the page appears I input a figure via a input field and insert it into the DB. I insert the persons ID and input field value. This I am able to do OK.<BR><BR>I need to do this for around 30 people. So I have to go through this process for all 30 people!!<BR><BR>Can I create a recordset and display each persons info on one page with an input field for each record?<BR><BR>IE: <BR><BR>123 - D.SMITH - [Textfield]<BR>458 - J.Gold - [TextField]<BR>753 - G.Swift - [Textfield]<BR><BR>Can I then insert the data into the DB from this one page for all 30 people???<BR>If so how???<BR><BR>Many Thanks<BR><BR>Darrell...<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Add Multiple Records From One ASP Page

    Yes, but you will need to make multiple trips to the db.<BR>Just make a loop for 30 people for all the text fields, and name each one to include the loop index(the i of the loop).<BR><BR>what i mean<BR><BR>for i = 1 to 30<BR>response.write "&#060;input type=""text"" name=""id_" & i & """&#062;"<BR>next<BR><BR>and then on your second page do about the same thing:<BR><BR>for i = 1 to 30<BR><BR>id = request.querystring("id_" & i)<BR>sql = "insert into yourTable(id) values(" & id & ")"<BR>yourConn.execute(sql)<BR><BR>next

Posting Permissions

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