当前位置: 代码迷 >> ASP >> ADODB.Connection '800a0e78' 对象关闭时,不允许操作。 \result.asp, line 29解决办法
  详细解决方案

ADODB.Connection '800a0e78' 对象关闭时,不允许操作。 \result.asp, line 29解决办法

热度:1121   发布时间:2012-04-22 18:34:46.0
ADODB.Connection '800a0e78' 对象关闭时,不允许操作。 \result.asp, line 29
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>


------解决方案--------------------
如果你的连接正处于打开状态,应该建立个adodb.recordset,从目前的代码来看,你只建立了连接adodb.connection,但并没有打开数据表。
  相关解决方案