Problem with multiple update form

Results 1 to 2 of 2

Thread: Problem with multiple update form

  1. #1
    Join Date
    Dec 1969

    Default Problem with multiple update form

    I have a form that I use to do multiple updates of records.<BR>These records are in a table which holds the users id number, the course they are in and the grade the got in the course. <BR>The id number is passed from another page and stored in a session variable. <BR><BR>Here is the code used to upgrade the table <BR><BR>&#060;% for x= 1 to 10 <BR>Recordset1.Fields.Item("CBRequiredCourse") = request ("Coursename" & x)<BR>Recordset1.Fields.Item("CBRequiredGrade") = request ("grade" & x)<BR>Recordset1.update<BR>Recordset1.movenext<BR> Next<BR>Recordset1.movefirst<BR>%&#062;<BR><BR>Whe n I use this to update a user with an id number like 1234567 there is no problem and everything works correctly. When I attempt to update a user with an id like 0234054 I get an error. If I remove the 0 from the front of the id number the grades and courses update properly. <BR><BR>The database that is attempting to be updated is an Access Database and the field that stores the id number is a textfield. All the other tables in the database will accept numbers with a zero but this one will not. should I be adding the id number to each record update as well or should I be converting the number to string? <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with multiple update form

    hmm.<BR><BR>i would prefer to prescribe a better way to do an update.<BR><BR>sql = "update Tablename Set colname = &#039;"& request("coursename") & x) &"&#039;,colname2="& request("grade" & x) <BR>where userid = &#039;"& youruserid &"&#039;"<BR><BR>openconnection<BR>executesql<BR>d estroyconnection<BR><BR>open a connection

Posting Permissions

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