| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 951 人关注过本帖
标题:提示错误说对象已关闭,不能实现连续操作,该怎么改啊,各位帮帮我。
只看楼主 加入收藏
Kettyjin1983
Rank: 1
等 级:新手上路
帖 子:303
专家分:0
注 册:2007-8-17
结帖率:66.67%
收藏
 问题点数:0 回复次数:3 
提示错误说对象已关闭,不能实现连续操作,该怎么改啊,各位帮帮我。
<%@ LANGUAGE="vbscript" %>
<!--#include virtual ="/Include/Conn.asp"-->
<!--#include virtual ="/Include/Frequent.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" c>
<meta name="GENERATOR" c>
<meta name="ProgId" c>
<title>THANKS FOR YOUR SUPPORT</title>
</head>
<body bgcolor="#FFFFFF">
<p>   </p>
  <%
owner=session("owner")
if owner = "" then
  response.redirect "index.htm"
else
  set conn=server.createobject("adodb.connection")
  set rs=server.createobject("adodb.recordset")
  c
  conn.open = constr
  rs.open "SELECT * from mtrack2 where owner = '"&owner&"'and barstatus='wait' and tobe = ''", conn,1,1
  Set temprs = Server.CreateObject("ADODB.Recordset")
  do while not rs.eof
   autoid = rs("autoid")
   tobe = "select"&autoid
   Set temprs = Server.CreateObject("ADODB.Recordset")
   tobe=Trim(Request.Form(tobe))
   response.write tobe
   temprs.open "update mtrack2 set tobe= '"&tobe&"'where autoid='"&autoid&"'",conn,1,3
   
    MailBody="EXEC xp_sendmail "
   
     MailBody=MailBody&"@recipients = '"&tobe&"',"
   
    MailBody=MailBody & "@copy_recipients='" & owner &"',"
   
    MailBody=MailBody & "@subject='Barcode transfer to you from " & owner & "',"
    MailBody=MailBody & "@message='All," & Chr(13)
    MailBody=MailBody & "Please be informed that there is some barcode transfered to you,please visit [url=http://hzmot/quick/m-track/transfer.asp]http://hzmot/quick/m-track/transfer.asp[/url] to take some action."& Chr(13)&Chr(13)
    MailBody=MailBody & "Thanks for your support.'" & Chr(13) & Chr(13)
     call SendMyMail(MailBody)
   temprs.close
   set temprs = nothing
  
  rs.movenext
  
 loop
 
 rs.close
 set rs = nothing
 conn.Close
 set conn = nothing
end if
'response.redirect "transfer.asp"
%>
 
</body>
</html>
搜索更多相关主题的帖子: 连续操作 对象 meta 提示 
2007-12-06 16:30
Kettyjin1983
Rank: 1
等 级:新手上路
帖 子:303
专家分:0
注 册:2007-8-17
收藏
得分:0 
temprs.open "update mtrack2 set tobe= '"&tobe&"'where autoid='"&autoid&"'",conn,1,3
提示说在第36行,也就是temprs,这里,
[color=black]各位帮我看看啊,自己先顶

[/color]
2007-12-06 16:32
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
Set temprs = Server.CreateObject("ADODB.Recordset")
  do while not rs.eof
   autoid = rs("autoid")
   tobe = "select"&autoid
   Set temprs = Server.CreateObject("ADODB.Recordset")
为什么会有两句
Set temprs = Server.CreateObject("ADODB.Recordset")
还有建议楼主的sql语句中间最好有适当的间隔
如:
temprs.open "update mtrack2 set tobe= '"&tobe&"'where autoid='"&autoid&"'",conn,1,3
写成
temprs.open "update mtrack2 set tobe= '"&tobe&" 'where autoid='"&autoid&"'",conn,1,3
比较好
2007-12-06 18:07
Kettyjin1983
Rank: 1
等 级:新手上路
帖 子:303
专家分:0
注 册:2007-8-17
收藏
得分:0 
<%@ LANGUAGE="vbscript" %>
<!--#include virtual ="/Include/Conn.asp"-->
<!--#include virtual ="/Include/Frequent.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" c>
<meta name="GENERATOR" c>
<meta name="ProgId" c>
<title>THANKS FOR YOUR SUPPORT</title>
</head>
<body bgcolor="#FFFFFF">
<p>   </p>
  <%
owner=session("owner")
if owner = "" then
  response.redirect "index.htm"
else
  set conn=server.createobject("adodb.connection")
  set rs=server.createobject("adodb.recordset")
  c
  conn.open = constr
  rs.open "SELECT * from mtrack2 where owner = '"&owner&"'and barstatus='wait' and tobe = ''", conn,1,1
  
  do while not rs.eof
   autoid = rs("autoid")
   tobe = "select"&autoid
   Set temprs = Server.CreateObject("ADODB.Recordset")
   tobe=Trim(Request.Form(tobe))
   response.write tobe
   temprs.open "update mtrack2 set tobe= '" &tobe& "'where autoid='" &autoid& "'",conn,1,3
   
    MailBody="EXEC xp_sendmail "
   
     MailBody=MailBody&"@recipients = '" &tobe& "',"
   
    MailBody=MailBody & "@copy_recipients='" & owner &"',"
   
    MailBody=MailBody & "@subject='Barcode transfer to you from " & owner & "',"
    MailBody=MailBody & "@message='All," & Chr(13)
    MailBody=MailBody & "Please be informed that there is some barcode transfered to you,please visit [url=http://hzmot/quick/m-track/transfer.asp]http://hzmot/quick/m-track/transfer.asp[/url] to take some action."& Chr(13)&Chr(13)
    MailBody=MailBody & "Thanks for your support.'" & Chr(13) & Chr(13)
  
    call SendMyMail(MailBody)
   Temprs.close
   set temprs = nothing
  
  rs.movenext
  
 loop
 
 rs.close
 set rs = nothing
 conn.Close
 set conn = nothing
end if
%>
 
</body>
</html>

错误提示:
ADODB.Recordset 错误 '800a0e78' 对象关闭时,不允许操作。 /quick/m-track/dealtransfer.asp,行51

执行时,邮件只能发出去一份,也就是只能执行一次循环,第二次就不行了。不知道怎么回事啊,帮我看下啊
2007-12-07 09:13
快速回复:提示错误说对象已关闭,不能实现连续操作,该怎么改啊,各位帮帮我。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026337 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved