测试时遇到这样的问题:错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/coplion/left.asp, 第 39 行(红色字为39行)
我自己修改了很久,还是 未能找到错误,郁闷ing~~~
以上是具体代码:
-----------------------------------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if session("user_name")<>"" then
%>
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject(adodb.recordset)
sql="select * from user where user_name='"&session("user_name")&"'"
rs.open sql,conn,3,3
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>左侧菜单</title>
</head>
<body>
<td width="100%" bgcolor="#ff9933" height="18">用户信息</td><br>
<td width="100%" bgcolor="#FFFFFF">用户名:<%rs=("user_name")%><br>地址:<%rs=("user_adds")%><br>
邮编:<%=rs("user_postcode")%></td>
<%rs.close%>
<%else%>
<td width="100%" bgcolor="#FF9933" height="18">用户登录</td>
<form method="post" action="login.asp">
用户名:<input type="text" name="user_name" size="18" class=input><br>
密 码:
<input type="password" name="user_pass" size="18" class=input><br>
<input type="submit" value="确定" name="B1" class=input> <a href="reg.asp">用户注册</a>
</form>
<%end if%>
<td width="100%" bgcolor="#ff9933" height="18">订单查询</td>
<form method="post" action="query.asp">
<input type="text" name="sub_number" size="17" class=input>
<input type="submit" value="确定" name="B1" class=input>
</form>
<%
sql2="select * from newsclass"
set rs2=server.CreateObject("adodb.recordset")
rs2.open sql2,conn,3,3
if rs2.eof then
%>
<tr>
<td width="100%" height="18" bgcolor"#ff9933">暂且没有分类</td>
<%else
do while not rs2.eof
%>
<tr>
<td width="100%" height="18" bgcolor="#ff9933"><%=rs("newclass_name")%>
<%
newclass_id=rs2("newclass_id")
sql1="select top 10 * from news where newsclass_id='"&newsclass_id&"'order by news_id DESC"
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,3,3
if rs1.eof then
response.write"暂且没有新闻"
else
do while not rs1.eof
%>
<%
if len(rs1("news_title"))>11 then
news_title=left(rs1("news_title"),11)
%>
<a href="news.asp?news_id=<%rs1("news_id")%>"><%=news_title%></a>
<%else%>
<a href="news.asp?news_id=<%=rs1("news_id")%>"><%rs1=("news_title")%></a>
<%end if%>
<br>
<%
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
<%
rs.movenext
loop
end if
rs.close
set rs1=nothing
%>
<td width="100%" height="18" bgcolor="#ff9933">用户投诉</td>
<form method="post" action="userts.asp">
用户名:<input type="text" name="user_name" size="14" class=input><br>
订单号:<input type="text" name="sub_number" size="14" class=input><br>
<input type="submit" value="提交" name="B1" class=input>
</form>
<form method="post" action="search.asp">
商品列表:<select size="1" name="sort_id">
<%
sql="select * from sort"
rs.open sql,conn,3,3
if not rs.eof then
do while not rs.eof
%>
<option value="<%=rs("sort_id")%>"><%=rs("sort_name")%></option>
<%rs.movenext
loop
end if
rs.close
%>
</select><br>
关键字:<input type="text" name="hw_name" size="14" class=input><br>
<input type="submit" value="提交" name="B1" class=input>
</form>
</body>
</html>
----------------------------------------------------------------------------
关注online