Forums

ASP

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>
&lt;%@language=vbscript%&gt;
&lt;%option explicit%&gt;
&lt;%
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
%&gt;
&lt;html&gt;
&lt;head&gt;&lt;TITLE&gt;Vioce Of Baraunians&lt;/TITLE&gt;&lt;/head&gt;
&lt;body bgcolor="#FFFFFF" background="back.gif"&gt;
&lt;form name="update" action="update1.asp" method="post"&gt;
&lt;!--#include file="front.inc"--&gt;


&lt;meta http-equiv="Content-Type" content="text/html; charet=iso-8859-1"&gt;
&lt;div style="position:absolute; top:100; left:0 "&gt;
&lt;table width="1000" border="0" cellspacing="1" cellpadding="3" bgcolor="#663333" &gt;
&lt;tr bgcolor="#CCCCFF"&gt;
&lt;td width="8%" &gt;&lt;b&gt;TOPIC ID&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#CCCCFF" colspan="50%"&gt; &lt;b&gt;TOPIC SUBJECT&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#CCCCFF" colspan="50%"&gt;&lt;b&gt;MESSAGE&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#CCCCFF" width="12%"&gt; &lt;b&gt;POSTED BY&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#CCCCFF" width="12%"&gt;&lt;b&gt;POSTED DATE&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#CCCCFF"&gt;&lt;b&gt;Permission&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#FFFFFF"&gt;
&lt;td bgcolor="#66FF99" width="8%"&gt;&lt;%=R("top_id"%&gt;&lt;/td&gt;
&lt;td align="left" colspan="50%" bgcolor="#66FF99"&gt;&lt;b&gt;&lt;font face="arial" size=2&gt;&lt;%Response.Write R("top_sub"%&gt;&lt;/font&gt;&lt;/b&gt;&lt;/td&gt;
&lt;td bgcolor="#66FF99" COLSPAN="50%"&gt;&lt;%=R("msg"%&gt;&lt;/td&gt;
&lt;td bgcolor="#66FF99" width="12%"&gt;&lt;%=R("launch_by"%&gt;&lt;/td&gt;
&lt;td bgcolor="#66FF99" width="12%"&gt;&lt;%=R("launch_dt"%&gt;&lt;/td&gt;
&lt;td width="10%"&gt;&lt;font face="arial" size="2"&gt;&lt;b&gt;Apply&lt;/b&gt;&lt;/font&gt;
&lt;select name="vopenflg"&gt;
&lt;option value=" " &gt;Normal&lt;/option&gt;
&lt;option value="0" &gt;Abuse&lt;/option&gt;
&lt;option value="1"&gt;clsoe&lt;/option&gt;
&lt;/select&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="1000" border="0" cellspacing="1" cellpadding="3" &gt;
&lt;tr align="right" bgcolor="#99FFFF"&gt;
&lt;td&gt;&lt;b&gt;Voice of Baraunians views&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;%Response.write(Application("visitors")%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;%
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
%&gt;
&lt;table width=765&gt;
&lt;tr&gt;&lt;td width="60%"&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type= "submit" name="submit" value="Apply"&gt;
&lt;input type="button" name="submit" value="Back" onclick="moderate()"&gt;
&lt;input type ="button" value="EXIT" onClick="window.close()"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;script language="Javascript"&gt;
function moderate()
{
window.location = "moderator1.asp"
}
&lt;/script&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</font id=code></pre id=code>

jha

Reply to this topic