Editable multiple records in Table

Results 1 to 3 of 3

Thread: Editable multiple records in Table

  1. #1
    Ian Mayo Guest

    Default Editable multiple records in Table

    Hi,<BR>I&#039;m sure this is possible using just ASP (not custom components) but haven&#039;t seen it done.<BR>I&#039;d like to be able let the user edit multiple records in a table, not just display the recordset then click on one to go to a column-format edit page.<BR>Can anybody point me to any examples? <BR><BR>I&#039;ve tried to think it through, it&#039;s easy to populate the edit controls in the table, but when I&#039;m processing the submitted form I&#039;m not sure how to identify which record the controls relate to (although I was considering combining the record id and field name in the name of the control - but would like to find a simpler version first)<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Editable multiple records in Table

    I&#039;ve done something like this, all you need to pass when submitting the form is the x co-ordinates (the field) and y co-ordinate (the record) as you can work out what field you are dealing with by number.<BR><BR>To make it smoother/faster for the user, I used a table with text boxes (use style settings) to make the form elements look flat and highlight when selected etc.. All data processing is done via a hidden frame so the page never needs refreshing. Then end result is something similar to an Access table edit.<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Editable multiple records in Table

    Here&#039;s how I do it...<BR><BR>When you populate the record set you append a number on to each field using a count<BR><BR>FLDcount = FLDcount + 1<BR>name & FLDcount<BR><BR>Would output the following for 5 records....<BR>name_1 surname_1 Address_1 IDfld_1<BR>name_2 surname_2 Address_2 IDfld_2 <BR>name_3 surname_3 Address_3 IDfld_3<BR>name_4 surname_4 Address_4 IDfld_4<BR>name_5 surname_5 Address_5 IDfld_5<BR><BR>Now you need to tell your recieving page how many records to process in the loop you are going to put in..<BR>HiddenField = FldCount<BR><BR>Would output 5 because thats where your recordset stopped.<BR><BR><BR>NEXT page.......<BR><BR><BR>For i = 1 to request.Form("HiddenFieldCount")<BR><BR> name = request.form("name_" & i)<BR> surname = request.form("surname_" & i)<BR> address = request.form("address_" & i)<BR> idFLD = request.form("IDfld_" & i)<BR> <BR>&#039;Now we insert the info while still in the loop...<BR>MySQL = "Update tableName set " &_<BR> "name = &#039;" & name & "&#039;," &_<BR> "surname = &#039;" & surname & "&#039;," &_<BR> "address = &#039;" & address & "&#039; where " &_<BR> "fldID = " & fldID<BR><BR>MyConn.Execute(MySQL)<BR><BR>Next<BR> <BR>&#039;now back to the top with a new variable number and hence a new record.<BR><BR>Because of the hidden field supplying a count variable each field is extracted dynamically. Using this method you could update as many records as you like.<BR><BR>Hope this helps<BR><BR><BR>Dwane Lumley<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