home *** CD-ROM | disk | FTP | other *** search
/ sau9.org / sau9.org.zip / sau9.org / mathapp / student_confirm.asp < prev    next >
Text File  |  2002-11-20  |  2KB  |  67 lines

  1. <%@ Language=VBScript %>
  2. <%
  3.  Response.Buffer = True
  4.  
  5.  
  6. Function ChkString(string)
  7.   If string = "" Then string = " "
  8.    ChkString = Replace(string, "'", "''")
  9.    End Function
  10.  
  11. set tn = request.form("tn")
  12. response.write "<table> <tr> <Td><Font face=tahoma size=4><h2> Student Confirmation "
  13.  
  14. response.write "</td><td> <img src=math.gif width=140></td></tr></table>"
  15.  
  16. Dim iCount
  17.   iCount= Request("Count")
  18.  
  19.  
  20.  
  21. filePath = Server.MapPath("math_proj.mdb")
  22. Set conn = Server.CreateObject("ADODB.Connection")
  23.  
  24. conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  25.  
  26. Dim iLoop
  27.  
  28. for iLoop = 0 to iCount
  29.  
  30.  
  31.       ' Receiving values from Form
  32. strID=iLoop & ".id"
  33.    id = ChkString(Request.Form(strID))
  34. strfname=iLoop & ".fname"
  35. fname=request.Form(strfname)
  36.  
  37. strlname=iLoop & ".lname"
  38.    lname =ChkString(Request.Form(strlname))
  39. strgrade=iLoop & ".grade"
  40.     grade=ChkString(Request.Form(strgrade))
  41. strPassword=iLoop & ".Password"
  42.     Password=ChkString(Request.Form(strpassword))
  43. strteacherlast=iLoop & ".teacherlast"
  44.     teacherlast=ChkString(Request.Form(strteacherlast))
  45. strteacherfirst=iLoop & ".teacherfirst"
  46.     teacherfirst=ChkString(Request.Form(strteacherfirst))
  47.  
  48.  
  49. sql_update = "UPDATE tblStudent set idStudent='" & id & "', txtFName='"
  50. sql_update=sql_update & fname & "', txtLName='"
  51. sql_update=sql_update & lname & "', txtgrade='"
  52. sql_update=sql_update & grade & "', pwStudent='"
  53. sql_update=sql_update & password & "' WHERE idstudent="
  54. sql_update=sql_update & id
  55.  
  56. 'response.write sql_update
  57.  
  58. 'response.write "<br>Loop=" & iLoop
  59. 'response.write "<br> Count=" & iCount
  60. conn.Execute (sql_update)
  61.    ' Done. Close the connection
  62. next
  63.  
  64. %>
  65.  
  66. Your questions have been edited.  <a href=student_admin.asp>Review </a> the questions.
  67. </html>