以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Dot NET,C#,ASP,VB 』  (http://bbs.xml.org.cn/list.asp?boardid=43)
----  基于asp+sql的数据库修改问题[求助]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=43&rootid=&id=33141)


--  作者:drury
--  发布时间:5/26/2006 10:55:00 PM

--  基于asp+sql的数据库修改问题[求助]
我做了一个基于asp+sql的 网上办公系统 近期就要完工 但是遇到了一个棘手问题 (因为不能上传抓图,所以我写的很详细,)
数据库: 表: article
         列名 :  id         int       4
                  content    ntext     16
                  tltle      nvarchar  50
                  ifpass     smallint   2
                  updata     smallint   2
----------------------------------------------
up.asp (代码)
        
   <%
  if session("degree")<>1 then
   response.redirect "login.asp"
  end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
<!--
.STYLE1 {color: #FF9933}
-->
</style>
</head>
<!--#include file="conn.asp"-->
<%
  dim sql
  dim rs
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from article where ifpass=1 and updata=0 order by id desc"
rs.open sql,conn,1,1

%>

<div align="center"><center>
<br>
<span class="b1">以下列出所有已通过审核的公文<br>
<br>
可将公文上传转交至总公司</span><br>
<div align="center"><center><table border="1" cellspacing="0" width="443" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0">
        <tr>
          <td width="50" align="center" bgcolor="#D0D0D0" height="20"><strong>ID</strong></td>
          <td width="314" align="center" bgcolor="#D0D0D0"><div align="center"><strong>公文标题</strong></div></td>
          
          <td width="71" align="center" bgcolor="#D0D0D0"><input type='submit' class=buttonface value='上报'></td>
        </tr>
<%do while not rs.eof%>
        <tr>
          <td height="23" width="50"><p align="center"><%=rs("id")%></td>
          <td width="314"><p align="center"><%=rs("title")%></td>
          
          <td width="71"><p align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></td>
        </tr>
<%
 
       rs.movenext
 loop
%>
      </table>
      </center></div>
<%
sub up(id)
    dim rs,sql
    set rs=server.createobject("adodb.recordset")
    sql="select updata from article"
 rs.open sql,conn,1,3
 (******这里不会写了,不知道前面有没有写错*****)
End sub
%>

---------------------------------------------------

这个文件的功能目的是  
  以表格形式列出数据库中ifpass=1并且updata=0的所有的项
显示出id,title的值,在每个id后面对应有多选框,当选种其中一个或者多个多选框后 点击(上报)按钮后 实现将前面所有选中的多选框对应的id对应的数据updata中的值(以前是0)改为(1)
怎么做?
我还是学生,不懂的太多 希望高手帮我解决下
我有网页运行的效果图,但是不能再此发布,所以我留下我的联系方式
qq:77656511  email:drury@126.com  

----------------------------------附上文件conn.asp代码----
<%
dim conn,strcnn
Set conn = Server.CreateObject("ADODB.Connection")
strcnn="Provider=sqloledb;User id=sa;Password=admin;Initial Catalog=archives;Data Source=(local)"
conn.Open strcnn
%>
-----------------------------------------------------

谢谢!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms