主题:[讨论]新手ADODB.Recordset (0x800A0BB9)问题,请大家帮忙
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/cx.asp, 第 57 行
---conn.asp-----
<%
dim conn
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("xxgl.mdb")
function closeconn()
conn.close()
set conn=nothing
end function
%>
-------cx.asp------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!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>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #333333;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<body>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/yd.gif" width="778" height="150" /></td>
</tr>
<tr>
<td height="20" align="right" bgcolor="#B2C6F6">药店信息管理 </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="center" valign="middle"><span class="STYLE1">查 询 结 果</span></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" style=" border-bottom:1px #CCCCCC dotted;border-top:1px #CCCCCC dotted;border-left:1px #CCCCCC dotted;border-right:1px #CCCCCC dotted">
<tr>
<td width="63" align="center" bgcolor="#FFFFFF">ID</td>
<td width="63" align="center" bgcolor="#FFFFFF">编号</td>
<td width="333" height="30" align="center" bgcolor="#FFFFFF">药店名称</td>
<td width="124" align="center" bgcolor="#FFFFFF">用户名</td>
<td width="124" align="center" bgcolor="#FFFFFF">密码</td>
<td width="126" align="center" bgcolor="#FFFFFF">注册码</td>
</tr>
<%
cx=request.Form("cx")
sel=request.Form("sel")
if sel="bianhao" then
sql="select * from yd where yd_id like'%"&cx&"%'"
end if
if sel="mingcheng" then
sql="select * from yd where yd_name like'%"&cx&"%'"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,2,3
if rs.recordcount<0 then
response.Write "对不起没有找的相关的内容!"
else
do while not rs.eof
%>
<tr>
<td width="78" align="center" valign="middle" bgcolor="#FFFFFF"><%=rs("id")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_id")%></td>
<td width="350" height="20" bgcolor="#FFFFFF"><%=rs("yd_name")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_username")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_psw")%></td>
<td width="150" bgcolor="#FFFFFF"><%=rs("yd_zcm")%></td>
</tr>
<%
rs.movenext
loop
%>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%end if%>
</body>
</html>
请各位高手指点,看看错在那里了,我在网上看了好多关于此类的问题,还是没找到解决的方法,急啊``````
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/cx.asp, 第 57 行
---conn.asp-----
<%
dim conn
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("xxgl.mdb")
function closeconn()
conn.close()
set conn=nothing
end function
%>
-------cx.asp------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!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>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #333333;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<body>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/yd.gif" width="778" height="150" /></td>
</tr>
<tr>
<td height="20" align="right" bgcolor="#B2C6F6">药店信息管理 </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="center" valign="middle"><span class="STYLE1">查 询 结 果</span></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" style=" border-bottom:1px #CCCCCC dotted;border-top:1px #CCCCCC dotted;border-left:1px #CCCCCC dotted;border-right:1px #CCCCCC dotted">
<tr>
<td width="63" align="center" bgcolor="#FFFFFF">ID</td>
<td width="63" align="center" bgcolor="#FFFFFF">编号</td>
<td width="333" height="30" align="center" bgcolor="#FFFFFF">药店名称</td>
<td width="124" align="center" bgcolor="#FFFFFF">用户名</td>
<td width="124" align="center" bgcolor="#FFFFFF">密码</td>
<td width="126" align="center" bgcolor="#FFFFFF">注册码</td>
</tr>
<%
cx=request.Form("cx")
sel=request.Form("sel")
if sel="bianhao" then
sql="select * from yd where yd_id like'%"&cx&"%'"
end if
if sel="mingcheng" then
sql="select * from yd where yd_name like'%"&cx&"%'"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,2,3
if rs.recordcount<0 then
response.Write "对不起没有找的相关的内容!"
else
do while not rs.eof
%>
<tr>
<td width="78" align="center" valign="middle" bgcolor="#FFFFFF"><%=rs("id")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_id")%></td>
<td width="350" height="20" bgcolor="#FFFFFF"><%=rs("yd_name")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_username")%></td>
<td width="100" bgcolor="#FFFFFF"><%=rs("yd_psw")%></td>
<td width="150" bgcolor="#FFFFFF"><%=rs("yd_zcm")%></td>
</tr>
<%
rs.movenext
loop
%>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%end if%>
</body>
</html>
请各位高手指点,看看错在那里了,我在网上看了好多关于此类的问题,还是没找到解决的方法,急啊``````