Forums
This topic is locked
update row with select option
Posted 12 Nov 2007 10:28:28
1
has voted
12 Nov 2007 10:28:28 sanjeev jha posted:
hi i am change my logic like this link with another page top_id and topicsubject on click topic subject its detail is display on next page called update1.asp i wants to upadta the displyed details column open_flg status plz this is my code for display and update this is display link wise detail but not update so help in updation <pre id=code><font face=courier size=2 id=code>
<%@language=vbscript%>
<%option explicit%>
<%
If Request.Cookies("userid" = "" Then
Response.Redirect "login.asp"
Else
dim my_conn_stRing, conn,R,R1,R2, sql,Rcount,Rpage,page,i,vopenflg
dim stroutput,reply,repcount,stropt1,vtopid
MY_CONN_STRING = "dsn=oracle;uid=starter;pwd=starter;"
Set Conn = server.createobject("ADODB.Connection"
conn.mode=admodereadwrite
Conn.open MY_CONN_STRING
set R = Server.CreateObject("ADODB.Recordset"
for each stropt1 in request.QueryString
vtopid=request.QueryString(stropt1)
R.open "Select top_id,top_sub,MSG,open_flg,launch_by,launch_dt from topmaster where top_id="&vtopid&" order by top_id desc ",conn, adOpenStatic, adLockOptimistic, adCmdText
%>
<html>
<head><TITLE>Vioce Of Baraunians</TITLE></head>
<body bgcolor="#FFFFFF" background="back.gif">
<form name="update" action="update1.asp" method="post">
<!--#include file="front.inc"-->
<meta http-equiv="Content-Type" content="text/html; charet=iso-8859-1">
<div style="position:absolute; top:100; left:0 ">
<table width="1000" border="0" cellspacing="1" cellpadding="3" bgcolor="#663333" >
<tr bgcolor="#CCCCFF">
<td width="8%" ><b>TOPIC ID</b></td>
<td bgcolor="#CCCCFF" colspan="50%"> <b>TOPIC SUBJECT</b></td>
<td bgcolor="#CCCCFF" colspan="50%"><b>MESSAGE</b></td>
<td bgcolor="#CCCCFF" width="12%"> <b>POSTED BY</b></td>
<td bgcolor="#CCCCFF" width="12%"><b>POSTED DATE</b></td>
<td bgcolor="#CCCCFF"><b>Permission</b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#66FF99" width="8%"><%=R("top_id"%></td>
<td align="left" colspan="50%" bgcolor="#66FF99"><b><font face="arial" size=2><%Response.Write R("top_sub"%></font></b></td>
<td bgcolor="#66FF99" COLSPAN="50%"><%=R("msg"%></td>
<td bgcolor="#66FF99" width="12%"><%=R("launch_by"%></td>
<td bgcolor="#66FF99" width="12%"><%=R("launch_dt"%></td>
<td width="10%"><font face="arial" size="2"><b>Apply</b></font>
<select name="vopenflg">
<option value=" " >Normal</option>
<option value="0" >Abuse</option>
<option value="1">clsoe</option>
</select>
</tr>
</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>
</tr>
</table>
<%
If Not IsEmpty(Request.Form("submit") then
vopenflg = Request.Form("vopenflg"
vopenflg=trim(vopenflg)
R("open_flg"=vopenflg
R.update
R.Close
conn.close
end if
next
end if
%>
<table width=765>
<tr><td width="60%"></td>
<td><input type= "submit" name="submit" value="Apply">
<input type="button" name="submit" value="Back" onclick="moderate()">
<input type ="button" value="EXIT" onClick="window.close()"></td>
</tr>
</table>
<script language="Javascript">
function moderate()
{
window.location = "moderator1.asp"
}
</script>
</div>
</form>
</body>
</html>
</font id=code></pre id=code>
jha