| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3204 人关注过本帖
标题:高手快来指正下错误,谢谢!(急)
只看楼主 加入收藏
静静听风
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2007-12-13
收藏
 问题点数:0 回复次数:5 
高手快来指正下错误,谢谢!(急)
我不知道大概错在哪,所以把全部代码都发上来了,运行后提示错误:


ADODB.Recordset '800a0bb9'

参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

\wwwroot\book1.asp, line 175
175行如下
<%
Set rs= Server.CreateObject("ADODB.Recordset") '173
dd= "Select huifu FROM book " '174
rs.open dd,conn,1,1 '175行
%>

我仔细检查过代码,查询的字段还有表段都没错.但就是创建不了对象
我这个是个简单的留言本,用了SELECT CASE 把所有功能都写在了一个页面,我前面创建了一个对象集RS1用于显示留言,我想可能是因为冲突了.
麻烦高手门帮忙看看,小菜我感激不尽.

具体的代码如下:


<HTML><HEAD>

<STYLE>
A:link {
    COLOR: #C0C0C0; FONT-FAMILY: arial; TEXT-DECORATION: none
}
A:visited {
    COLOR: #FFFFFF; FONT-FAMILY: arial; TEXT-DECORATION: none
}
A:active {
    COLOR: #ff7f00; FONT-FAMILY: arial; TEXT-DECORATION: none
}
A:hover {
    COLOR: #ff7f00; FONT-FAMILY: arial; TEXT-DECORATION: none; LEFT: 1px; TOP: 1px; POSITION: relative;}
BODY {
    FONT-size: 12px; color:#C0C0C0; FONT-FAMILY: 宋体; background: #000000 URL(3.jpg) no-repeat left;}
TH {
    FONT-SIZE: 12px; FONT-FAMILY: 宋体
}
TD {
    FONT-SIZE: 12px; FONT-FAMILY: 宋体
}
</STYLE>

<title>听风留言本</title>
</HEAD>
<BODY topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<%dim lei
 if request("yezi") = "" or cint(request("yezi"))<0 then
 lei=1
 else
 lei=Cint(request("yezi"))
 end if
 %>
<% select case lei %>
<% case 1 %>
<!--#INCLUDE FILE="conn.asp" -->
<%
if Cint(request("page"))<1 or request("page")="" then
page=1
else
page=request("page")
end if
%>
<%
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "Select * FROM book Order By id Desc"
rs1.open sql1,conn,1,1
%>
<%
dim size,maxpage
size=10
rs.pagesize = size
rs.absolutepage = Cint(page)
all  = rs.RecordCount
maxpage=rs.pagecount
if page>maxpage then
page=maxpage
end if
%>
<%
rs.absolutepage = Cint(page)
%>
<div style="position: absolute; width: 360px; height: 142px; z-index: 1; left: 615px; top: 7px" id="layer1">
            <table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0" height="121">
                <tr>
                    <td width="100%" align="left" valign="top">
                    <% if not(rs.eof and rs.bof) then%>
                    <%do while not rs.eof%>
                    <table border="0" cellspacing="0" cellpadding="0" id="table6" style="width: 358px; text-align: left;table-layout:fixed" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: dotted; border-bottom-width: 1px">
                        <tr>
                            <td height="22" width="25%">
                            <p align="center"><font color="#00FFFF"><%=rs("name")%></font>(<%=rs("sex")%>)</td>
                            <td height="22" width="54%">
                            <p align="left">发表于:<%=rs("time")%></td>
                            <td height="22" width="5%">
                            <img border="0" src="WWW/ayueguan/images/icon_editor_icq.gif" width="16" height="16" alt="来自:<%=rs("from")%>"></td>
                            <td height="22" width="5%">
                            <img border="0" src="WWW/ayueguan/images/icon_editor_oicq.gif" width="16" height="16" alt="QQ:<%=rs("qq")%>"></td>
                            <td height="22" width="5%">
                            <img border="0" src="WWW/ayueguan/images/icon_homepage.gif" width="16" height="16" alt="主页:<%=rs("home")%>"></td>
                            <td height="22" width="5%">
                            <img border="0" src="WWW/ayueguan/images/icon_editor_icq.gif" width="16" height="16" alt="电话:<%=rs("tel")%>"></td>
                        </tr>
                        <tr>
                            <td width="25%" rowspan="2">
                            <p align="center">
                            <img border="0" src="WWW/img/two.jpg" width="69" height="80"></td>
                            <td width="75%" colspan="5"><%=rs("neir")%></td>
                        </tr>
                        <tr>
                            <td height="25" width="75%" colspan="5">
                            <%if rs("huifu")<> "0" then%><font color="#FF0000">管理员回复:<%=rs("huifu")%></font><% end if%></td>
                        </tr>
                        <% if session("pass")="password" then%>
                        
                        <tr>
                            <td height="19" colspan="6">
                            <%if rs("huifu")<> "0" then%><p align="center"><a href="?yezi=3&id=<%=rs("id")%>">修改回复</a>&nbsp;&nbsp;&nbsp;
                            <%else%>
                            <p align="center"><a href="?yezi=3&id=<%=rs("id")%>">回复</a>&nbsp;&nbsp;&nbsp;
                            <% end if%>
                            <a href="DEL.ASP?id=<%=rs("id")%>">删除</a></td>
                        </tr>
                        <% end if%>
                    </table>
                    <%
                    rs.movenext
                    loop
                    %>
                    <%
                    else
                    response.write"暂时没有留言!"
                    end if
                    %>
                    </td>
                </tr>
            </table>
            <table border="0" width="100%" cellspacing="0" cellpadding="0" id="table7" height="20">
                <tr>
                    <td width="159" align="left" valign="bottom">
                            <a href="write.asp"><img border="0" src="WWW/ayueguan/images/icon_editor_oicq.gif" width="16" height="16">签写留言</a>&nbsp;&nbsp;
                            <a href="?yezi=2"><img border="0" src="WWW/ayueguan/images/icon_editor_oicq.gif" width="16" height="16">管理登陆</a></td>
                    <td>
                <% if not(rs.eof and rs.bof) then%>
                    <% if maxpage>1 then%>
                    <a href="?page=1">首页</a>|<a href="?page=<%=page-1%>">上一页</a>|<a href="?page=<%=page+1%>">下一页</a>|<a href="?page=<%=maxpage%>">尾页</a>
                    <% else %>
                    <p align="right">首页|上一页|下一页|尾页</p>
                    <%end if%>
                <%end if%></td>
                </tr>
            </table>
        <%rs.close%>
        </div>
<% case 2 %>
        <div style="position: absolute; width: 190px; height: 117px; z-index: 2; left: 649px; top: 200px" id="layer2">
            <form action="save_guanli.asp" method="post"><table border="0" width="100%" id="table8" cellspacing="0" cellpadding="0" height="115">
                <tr>
                    <td align="center" valign="bottom">++++++管理登陆++++++</td>
                </tr>
                <tr>
                    <td align="center" valign="bottom">用户名:<input type="text" name="name" size="11"></td>
                </tr>
                <tr>
                    <td align="center" valign="bottom">&nbsp; 密码:<input type="text" name="mima" size="11"></td>
                </tr>
                <tr>
                    <td align="center" valign="bottom">
                    <input type="submit" value="GO..." name="B1">&nbsp;
                    <a href="?">返回</a></td>
                </tr>
            </table></form>
</div>
<% case 3 %>
<% if session("pass")="password" then%>
<% if request("id")="" or cint(request("id"))<1 then
  response.redirect"?"
  else
  id=cint(request("id"))
   end if
%>
<%
Set rs= Server.CreateObject("ADODB.Recordset")
dd= "Select huifu FROM book "
rs.open dd,conn,1,1
%>
<%
    
rs1.move id,1
%>


<div style="position: absolute; width: 265px; height: 132px; z-index: 3; left: 641px; top: 345px" id="layer3">
<form action="save_huifu.asp?bookid=<%=id%>" method="post">
    <table border="0" width="100%" cellspacing="0" cellpadding="0" id="table9" height="131">
        <tr>
            <td height="20" colspan="2">
            <p align="center">+++++++<font color="#FF0000">回复留言</font>++++++</td>
        </tr>
        <tr>
            <td align="left" valign="top" colspan="2">
            <p align="center"><textarea rows="6" name="huifu" cols="22"><%if rs("huifu")<>"0" then%>
            <%=rs("huifu")%>
            <%end if%></textarea></td>
        </tr>
        <tr>
            <td height="19" width="57%">
            <p align="center"><input type="submit" value="提交" name="B2"></td>
            <td height="19" width="43%">
            <input type="reset" value="重置" name="B3"></td>
        </tr>
    </table></form>
</div>
<% else
   response.redirect"?yezi=2"
   end if
%>
<% end select %>
        
        </BODY></HTML>
搜索更多相关主题的帖子: 手快 
2008-01-10 14:46
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "Select * FROM book Order By id Desc"
rs1.open sql1,conn,1,1
%>
<%
dim size,maxpage
size=10
rs.pagesize = size
上面是截取楼主的一部分程序,怎么一会rs,一会rs1的,没看明白。
2008-01-10 14:56
liuhaifang
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-1-10
收藏
得分:0 
这段代码和我的很相似,可否加我QQ157411521
2008-01-10 15:08
静静听风
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2007-12-13
收藏
得分:0 
创建对象实例,不同功能的对象当然要附给不同的变量.
2008-01-10 15:10
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
你没定义rs,下面哪来的rs呢?我指的是2#那段代码
2008-01-10 21:07
wigal
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-1-12
收藏
得分:0 
<%
rs,open sql,conn,1,1
rs.absolutepage = Cint(page)
%>
这个执行是有问题的
   不明白的话看书啊!
<%
rs.open sql,conn,3,3
rs.absolutepage = Cint(page)
%>
就可以的!!
2008-01-12 16:41
快速回复:高手快来指正下错误,谢谢!(急)
数据加载中...
 
   



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

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