标题:ASP代码问题 急??
只看楼主
daidz
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-20
 问题点数:0 回复次数:4 
ASP代码问题 急??
ADODB.Recordset '800a0cc1'

在对应所需名称或序数的集合中,未找到项目。

\manage\VoteManage.asp, line 69



VoteManage.asp

<%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<%
dim sql,rs,Action,ID
Action=Trim(Request("Action"))
ID=Trim(Request("VoteID"))
if Action="Set" and ID<>"" then
    conn.execute "Update Vote set IsSelected=False where IsSelected=True"
    conn.execute "Update Vote set IsSelected=True Where ID=" & ID
    response.Write "<script language='JavaScript' type='text/JavaScript'>alert('设置成功!');</script>"
end if
sql="select * from Vote order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150" align="center" valign="top"> <table width="150" height="100%" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">
        <tr>
          <td align="center" valign="top"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center">功能菜单</td>
              </tr>
            </table>
            <table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0" class="MenuBg">
              <tr>
                <td align="center" valign="top"><br> <table width="90%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="16%"><img src="../Img/Left_1.gif" width="28" height="11"></td>
                      <td width="84%" height="20"><font color="#FFFF00">调查管理</font></td>
                    </tr>
                  </table>
                  <table width="90%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
                      <td width="66%" valign="bottom"><a href="VoteManage.asp"><font color="#FFFF00">调查设置</font></a></td>
                    </tr>
                  </table>
                  
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    <td width="862" align="center" valign="top">
    <br>
      <br>
      <b> </b><br>
      <p align="center"><strong>调 查 管 理<br>
        <br>
<form method="POST" action="VoteManage.asp">
        <p align="center"><strong>管理选项:</strong><a href="VoteAdd.asp">添加新调查</a></p>

        <table width="500" border="0" align="center" cellpadding="0" cellspacing="2" Class="border">
          <tr bgcolor="#C0C0C0" class="title">
            <td width="37" height="25" align="center">选择</td>
            <td width="37" align="center">ID</td>
            <td width="328" align="center">主题</td>
            <td width="88" align="center">操作</td>
    </tr>
<%
if not (rs.bof and rs.eof) then
    do while not rs.eof
%>
          <tr bgcolor="#E3E3E3" class="tdbg">
            <td width="37" height="22" align="center">
              <input type="radio" value=<%=rs("ID")%><%if rs("IsSelected")=true then%> checked<%end if%> name="VoteID"></td>
            <td width="37" height="22" align="center"><%=rs("ID")%></td>
            <td height="22">&nbsp;<%=rs("Title")%></td>
            <td width="88" height="22" align="center"><a href="VoteModify.asp?ID=<%=rs("ID")%>">修改</a>
              <a href="VoteDel.asp?ID=<%=rs("ID")%>">删除</a></td>
    </tr>
    <%
rs.movenext
loop
%>
    <tr class="tdbg">
      <td colspan=4 align=center><input name="Action" type="hidden" id="Action" value="Set">
        <input type="submit" value="将选定的调查设为最新调查" name="submit">
      </td>
    </tr>
<% end if%>
  </table>
</form>        </strong></p>
      </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>


VoteModify

<%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<%
dim ID,Title,VoteTime,IsSelected
dim rs,sql
ID=request("id")
Title=trim(request.form("Title"))
VoteTime=trim(request.form("VoteTime"))
if VoteTime="" then VoteTime=now()
IsSelected=trim(request("IsSelected"))
if IsSelected="True" then
    conn.execute "Update Vote set IsSelected=False where IsSelected=True"
end if
dim i
if ID="" then
    Response.Redirect "VoteManage.asp"
end if
sql="select * from Vote where ID="&Cint(ID)
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if not rs.eof then
    if Title<>"" then
        rs("Title")=Title
        for i=1 to 8
            if trim(request("select"&i))<>"" then
                rs("select"&i)=trim(request("select"&i))
                if request("answer"&i)="" then
                    rs("answer"&i)=0
                else
                    rs("answer"&i)=clng(request("answer"&i))
                end if
            else
                rs("select"&i)=""
                rs("answer"&i)=0
            end if
        next
        rs("VoteTime")=VoteTime
        rs("VoteType")=request("VoteType")
        if IsSelected="" then IsSelected=false
        rs("IsSelected")=IsSelected
        rs.update
        rs.close
        set rs=nothing
        call CloseConn()
        Response.Redirect "VoteManage.asp"
    end if
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150" align="center" valign="top"> <table width="150" height="100%" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">
        <tr>
          <td align="center" valign="top"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center">功能菜单</td>
              </tr>
            </table>
            <table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0" class="MenuBg">
              <tr>
                <td align="center" valign="top"><br> <table width="90%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="16%"><img src="../Img/Left_1.gif" width="28" height="11"></td>
                      <td width="84%" height="20"><font color="#FFFF00">调查管理</font></td>
                    </tr>
                  </table>
                  <table width="90%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
                      <td width="66%" valign="bottom"><a href="VoteManage.asp"><font color="#FFFF00">调查设置</font></a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    <td width="862" align="center" valign="top">
    <br>
      <br>
      <b> </b><br>
      <strong><b>修 改</b> 调 查</strong><br>
        <br>
<form method="POST" action="VoteModify.asp">
  <table width="500" border="0" align="center" cellpadding="2" cellspacing="2" Class="border">
    <tr class="tdbg">
      <td width="15%" align="right">主题:</td>
      <td width="85%" colspan="3"><input name="Title" type="text" value="<%=rs("Title")%>" size="52"></td>
    </tr>
    <%
for i=1 to 8%>
    <tr class="tdbg">
      <td align="right">选项<%=i%>:</td>
      <td><input name="select<%=i%>" type="text" value="<%=rs("select"& i)%>" size="36">
      </td>
      <td align="right">票数:</td>
      <td width="80"><input name="answer<%=i%>" type="text" value="<%=rs("answer"&i)%>" size="5"></td>
    </tr>
    <%next%>
    <tr class="tdbg">
      <td align="right">调查类型:</td>
      <td colspan="3"><select name="VoteType" id="VoteType">
          <option value="Single" <% if rs("VoteType")="Single" then %> selected <% end if%>>单选</option>
          <option value="Multi" <% if rs("VoteType")="Multi" then %> selected <% end if%>>多选</option>
        </select></td>
    </tr>
    <tr class="tdbg">
      <td align="right">&nbsp;</td>
      <td colspan="3"><input name="IsSelected" type="checkbox" id="IsSelected" value="True" <% if rs("IsSelected")=true then response.write "checked"%>>
        设为最新调查</td>
    </tr>
    <tr class="tdbg">
      <td colspan=4 align=center><input name="ID" type="hidden" id="ID" value="<%=rs("ID")%>">
        <input name="Submit" type="submit" id="Submit" value="保存修改结果"> </td>
    </tr>
  </table>
</form>       </strong></p>
      </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
搜索更多相关主题的帖子: ASP 代码错误 
2008-10-13 17:57
zcnvnv
Rank: 1
等 级:新手上路
帖 子:58
专家分:0
注 册:2008-7-8
得分:0 
看查询的表明、字段名、查询后用的变量名,看看有没有不对的
2008-10-13 18:27
nicechlk
Rank: 3Rank: 3
等 级:论坛游侠
威 望:4
帖 子:330
专家分:187
注 册:2008-9-6
得分:0 
代码太长了,看的都累。

莫以善小而不为,莫以恶小而为之!
2008-10-13 18:45
wxm198427
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:3
帖 子:561
专家分:25
注 册:2008-6-30
得分:0 
这个情况多半都是因为你的数据库中字段的问题,还有就是你的输出数据库中值的语句的那个<tr></tr><td></td>少了啊,多了啊,导致程序找不到数据库中相应的字段值,你还是仔细找找后面我说的那个原因吧,就是你要显示数据库中数据的那些代码!!!耐心点,细心点
2008-10-13 20:12
daidz
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-9-20
得分:0 
谢谢
2008-10-14 08:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-238019-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.180220 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved