<% For i = 1 to rs.PageSize '利用for next 循环依次读出当前页的记录 if rs.EOF then Exit For end if response.write("修改") response.write("文章标题是:"& rs("cn_title")) response.write(" 文章作者是:"& rs("cn_author")) response.write(" 文章加入时间是:"& rs("cn_time")) response.write(" 文章内容是:"& rs("cn_content")) response.write(" ") rs.MoveNext Next %> |
<% id=request.querystring("id") %> <%if request.form("submit")="change" then whattitle=request.form("title") whoauthor=request.form("author") whatcOntent=request.form("content") id=request.form("id") Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from cnarticle where cn_id="&id rs.Open sql,conn,3,2 rs("cn_title")=whattitle rs("cn_author")=whoauthor rs("cn_content")=whatcontent rs.update rs.close Set rs = Nothing conn.close set cOnn=Nothing response.redirect("showit.asp") response.end %> <%end if%> <% if id<>"" then Set rs = Server.CreateObject ("ADODB.Recordset") sql="select * from cnarticle where cn_id="&id rs.Open sql,conn,1,1 whattitle=rs("cn_title") whoauthor=rs("cn_author") whatcOntent=rs("cn_content") end if %> Title:> Author:> Content: |
<%if request.form("submit")="change" then whattitle=request.form("title") whoauthor=request.form("author") whatcOntent=request.form("content") id=request.form("id") sql = "update cnarticle set cn_title='"&whattitle&"',cn_author='"&whoauthor&"',cn_cOntent='"&whatcontent&"' where cn_id="&id conn.Execute(sql) conn.close set cOnn=Nothing response.redirect("showit.asp") response.end %> |