I have this code, and I trying to update records, but when I hit the submit button it does not save the changes
is there anyone out there that could help me
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../../../../../../Connections/cnnDB.asp" -->
<%
if(Request.QueryString("grd") <> "") then update__param_grade = Request.QueryString("grd")
if(Request.QueryString("chk") <> "") then update__param_index = Request.QueryString("chk")
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("str") <> "") Then
Recordset1__MMColParam = Request.QueryString("str")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_cnnDB_STRING
Recordset1.Source = "SELECT * FROM dbo.eval_master WHERE CRN = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
set update = Server.CreateObject("ADODB.Command")
update.ActiveConnection = MM_cnnDB_STRING
update.CommandText = "UPDATE dbo.eval_master SET GRADE = '" + Replace(update__param_grade, "'", "''") + "' WHERE INDEX1 IN ('" + Replace(update__param_index, "'", "''") + "') "
update.CommandType = 1
update.CommandTimeout = 0
update.Prepared = true
update.Execute()
set update = nothing
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="">
<label>
<input name="str" type="text" id="str" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
<form id="form2" name="form2" method="post" action="">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<table width="415" border="1">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td width="163"><label>
<input name="chk" type="text" id="chk" value="<%=(Recordset1.Fields.Item("INDEX1").Value)%>" />
</label></td>
<td width="163" height="39"><%=(Recordset1.Fields.Item("LAST").Value)%></td>
<td width="67"><label>
<select name="grd" id="grd" title="<%=(Recordset1.Fields.Item("GRADE").Value)%>">
<option>*</option>
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
</label></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
<p>
<label></label>
</p>
<p>
<label>
<input type="submit" name="Submit2" value="Submit" />
</label>
</p>
</form>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
is there anyone out there that could help me
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../../../../../../Connections/cnnDB.asp" -->
<%
if(Request.QueryString("grd") <> "") then update__param_grade = Request.QueryString("grd")
if(Request.QueryString("chk") <> "") then update__param_index = Request.QueryString("chk")
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("str") <> "") Then
Recordset1__MMColParam = Request.QueryString("str")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_cnnDB_STRING
Recordset1.Source = "SELECT * FROM dbo.eval_master WHERE CRN = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
set update = Server.CreateObject("ADODB.Command")
update.ActiveConnection = MM_cnnDB_STRING
update.CommandText = "UPDATE dbo.eval_master SET GRADE = '" + Replace(update__param_grade, "'", "''") + "' WHERE INDEX1 IN ('" + Replace(update__param_index, "'", "''") + "') "
update.CommandType = 1
update.CommandTimeout = 0
update.Prepared = true
update.Execute()
set update = nothing
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="">
<label>
<input name="str" type="text" id="str" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
<form id="form2" name="form2" method="post" action="">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<table width="415" border="1">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td width="163"><label>
<input name="chk" type="text" id="chk" value="<%=(Recordset1.Fields.Item("INDEX1").Value)%>" />
</label></td>
<td width="163" height="39"><%=(Recordset1.Fields.Item("LAST").Value)%></td>
<td width="67"><label>
<select name="grd" id="grd" title="<%=(Recordset1.Fields.Item("GRADE").Value)%>">
<option>*</option>
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
</label></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
<p>
<label></label>
</p>
<p>
<label>
<input type="submit" name="Submit2" value="Submit" />
</label>
</p>
</form>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>