高手快来指正下错误,谢谢!(急)
我不知道大概错在哪,所以把全部代码都发上来了,运行后提示错误: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>
<%else%>
<p align="center"><a href="?yezi=3&id=<%=rs("id")%>">回复</a>
<% 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>
<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"> 密码:<input type="text" name="mima" size="11"></td>
</tr>
<tr>
<td align="center" valign="bottom">
<input type="submit" value="GO..." name="B1">
<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>