Forums
This topic is locked
modify and update multipale rows in database
Posted 02 Nov 2007 11:51:11
1
has voted
02 Nov 2007 11:51:11 sanjeev jha posted:
can modify more then one field in database with select option if not then how can it modify more then one data in asp with vbscript if i am using r.update then only one record is update or modiy if more then one record on page then error is generate i am using this code<select name="vopenflg">
<%If IsEmpty(vopenflg) or vopenflg = 0 Then%>
<option value="0" selected>No</option>
<option value="1">Yes</option>
<option value="2">clsoe</option>
<%Elseif vopenflg =1 Then%>
<option value="0">No</option>
<option value="1" selected>Yes</option>
<option value="2">Close</option>
<%Elseif vopenflg =2 Then%>
<option value="0">No</option>
<option value="1">Yes</option>
<option value="2" selected>Close</option>
<%End If%>
</select>
</tr>
<%
R.movenext
If R.EOF Then
Exit For
end if
next
end if
R.close%>
</table>
<table width="1000" border="0" cellspacing="1" cellpadding="3" >
<tr align="right" bgcolor="#99FFFF">
<td><b>Voice of Baraunians views</b></td><td><%Response.write(Application("visitors")%></td>
<td> <%If page>1 Then %> <a href="moderator.asp?page=<%=page-1%>">Previous</a>
<%end if %>
<% If page < rpage Then %> <a href="moderator.asp?page=<%=page+1%>">Next</a>
<% end if %>
<%if rpage>1 then
for i=1 to Rpage
Response.write "<a href=""moderator.asp?page="&i&""">"&i&"</a> "
next
end if%> </td>
</tr>
</table><br>
<% conn.close
If Not IsEmpty(Request.Form("submit") then
vopenflg = Request.Form("vopenflg"
vopenflg=trim(vopenflg)
conn.Mode = adModeReadWrite
conn.open
R1.open "Select open_flg from topmaster ", conn, adOpenStatic, adLockOptimistic, adCmdText
R1("open_flg"= vopenflg
R1.update
R1.Close
end if
%>
jha