ADODB.Connection '800a0e78' 对象关闭时,不允许操作。 \result.asp, line 29
时间: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"> </td>
<td width="376"> </td>
<td width="200"> </td>
</tr>
<tr>
<td> </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> </td>
</tr>
<tr>
<td height="154"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
对象关闭时,不允许操作。
\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"> </td>
<td width="376"> </td>
<td width="200"> </td>
</tr>
<tr>
<td> </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> </td>
</tr>
<tr>
<td height="154"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
作者: wyf190575 发布时间: 2011-12-24
这样就可以
<!-- #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"> </td>
<td width="376"> </td>
<td width="200"> </td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle">
<%set rst=Server.CreateObject("ADODB.Connection")
set rst1=conn.Execute("insert into user(u_user,u_code) values('" & Request.form("f_user") & "','" & Request.form("f_code") & "')")
%>
<img src="img/zcsb.jpg" width="355" height="240" /><br>
<img src="img/zccg.jpg" width="357" height="229" /></td>
<td> </td>
</tr>
<tr>
<td height="154"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<!-- #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"> </td>
<td width="376"> </td>
<td width="200"> </td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle">
<%set rst=Server.CreateObject("ADODB.Connection")
set rst1=conn.Execute("insert into user(u_user,u_code) values('" & Request.form("f_user") & "','" & Request.form("f_code") & "')")
%>
<img src="img/zcsb.jpg" width="355" height="240" /><br>
<img src="img/zccg.jpg" width="357" height="229" /></td>
<td> </td>
</tr>
<tr>
<td height="154"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
作者: wyf190575 发布时间: 2011-12-24
如果你的连接正处于打开状态,应该建立个adodb.recordset,从目前的代码来看,你只建立了连接adodb.connection,但并没有打开数据表。
作者: jingxiaoping 发布时间: 2011-12-24
rst=Server.CreateObject("ADODB.Connection")
对象声明错误
rst=Server.CreateObjcet("ADODB.Recordset")
rst.open "select * from user where u_user='" & request.Form("f_user") & "'",conn,1,1
后最好加一个验证, 以防无记录的错误.
if not(rst.bof and rst.eof) then
...
end if
对象声明错误
rst=Server.CreateObjcet("ADODB.Recordset")
rst.open "select * from user where u_user='" & request.Form("f_user") & "'",conn,1,1
后最好加一个验证, 以防无记录的错误.
if not(rst.bof and rst.eof) then
...
end if
作者: kris2010 发布时间: 2011-12-24
回复等加分.
作者: hustgonia 发布时间: 2011-12-24
回复等加分.
作者: hustgonia 发布时间: 2011-12-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28