日期:2014-05-18  浏览次数:20506 次

asp中对象无法关闭该怎么解决?

ADODB.Recordset 错误 '800a0e78'

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

/通讯录/delnew.asp,行 12

代码:
<%
Dim objconn
Dim objrs
Dim sql
Dim bianhao
bianhao=request("userid")
sql="delete from net_table where userid="&"'"&bianhao&"'"
Set objconn=server.CreateObject("adodb.connection")
objconn.open"driver={SQL server};server=127.0.0.1; database=myform1;uid=sa;PWD=;"
Set objrs=server.CreateObject("adodb.recordset")
objrs.open sql,objconn,2,2
objrs.close
Set objrs=Nothing
objConn.close
Set objconn=Nothing
bianhao=bianhao&"信息已删除"
%>
<script language=vbscript>
  alert("<%=bianhao%>")
  Window.Location.href="index.asp"
  </script>

------解决方案--------------------
非sql server内容,请你去asp版问.
------解决方案--------------------
VB code

'这样试试,其实真正代码方式不是你这么写的,不过按你的改下试试、、。、
<%
Dim objconn
Dim objrs
Dim sql
Dim bianhao
bianhao=request("userid")
sql="delete from net_table where userid="&"'"&bianhao&"'"
Set objconn=server.CreateObject("adodb.connection")
objconn.open"driver={SQL server};server=127.0.0.1; database=myform1;uid=sa;PWD=;"
Set objrs=server.CreateObject("adodb.recordset")
objrs.open sql,objconn,2,2
bianhao=bianhao&"信息已删除"
objrs.close
Set objrs=Nothing
objConn.close
Set objconn=Nothing
%>
<script language=vbscript>
  alert("<%=bianhao%>")
  Window.Location.href="index.asp"
  </script>

------解决方案--------------------
sql="delete from net_table where userid="&"'"&bianhao&"'"
Set objconn=server.CreateObject("adodb.connection")
objconn.open"driver={SQL server};server=127.0.0.1; database=myform1;uid=sa;PWD=;"
objconn.exec(sql)
objConn.close
Set objconn=Nothing