+ -
当前位置:首页 → 问答吧 →  ADODB.Connection '800a0e78' 对象关闭时,不允许操作

ADODB.Connection '800a0e78' 对象关闭时,不允许操作

时间:2011-12-24

来源:互联网

引用楼主 wyf190575 的回复:
ADODB.Connection '800a0e78'

对象关闭时,不允许操作。

\result.asp, line 29




<!-- #include file="db.ins.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"……

作者: wyf190575   发布时间: 2011-12-24

贴全部额 
数据库操作那块代码贴出来

作者: enjoy_gw   发布时间: 2011-12-24

ADODB.Connection '800a0e78'  

对象关闭时,不允许操作。  

\result.asp, line 29




<!-- #include file="db.ins.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>注册结果</title>
<style type="text/css">
<!-
body {
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-repeat: no-repeat;
}
-->
</style></head>
<body>
<table width="800" border="0" align="center" cellspacing="0">
<tr>
<td width="218" height="72">&nbsp;</td>
<td width="376">&nbsp;</td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="center" valign="middle">
<%set rst=Server.CreateObject("ADODB.Connection")
rst.open "select * from user where u_user='" & request.Form("f_user") & "'",conn,1,1
if rst.recordcount>0 then 这行出错了
response.Write "用户名:" & request.Form("f_user") & "已经被占用!请点击后退按钮返回上一页!"
response.End()
else
set rst1=conn.Execute("insert into user(u_user,u_code) values('" & Request.form("f_user") & "','" & Request.form("f_code") & "')")
  end if
%>
<img src="img/zcsb.jpg" width="355" height="240" /><br>
<img src="img/zccg.jpg" width="357" height="229" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="154">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>




红色的加进去才不可以的

作者: wyf190575   发布时间: 2011-12-24

谁可以告诉我啊

作者: wyf190575   发布时间: 2011-12-24

红色部分的rst 是 ADODB.Connection 对象
你使用了open方法, 但参数是错误的, 不符合 Connection 规则, 所以接下来提示错误.
看你的程序是想打开记录, 查询 f_user 是否存在,
你只需要把上一句( 没标红色的) ADODB.Connection 改成 ADODB.Recordset 就行了.

你需要学习下ado的知识.

作者: kris2010   发布时间: 2011-12-24