设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 67|回复: 1
打印 上一主题 下一主题

[求助]如何解决ADODB.Recordset (0x800A0E78)对象关闭时,不允许操作。

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-20 02:15:22 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
这是个选课的程序,为什么提示:(奇怪的是虽然提示出错,可是依然可以选课成功.)希望大家帮我看下,帮我改正下错误,谢谢!!!!! 明天就要毕业答辩了...哭啊~~~在线等~~~
[知识问答ωωω.χiuGoo.сom]
错误类型:
ADODB.Recordset (0x800A0E78)
对象关闭时,不允许操作。
/SelectCourse/detectSelectCollision.asp, 第 26 行
--------------------------------------------------------
detectSelectCollision.asp代码如下:
--------------------------------------------------------
<!--#include file="../include/ADOVBS.asp"-->
<!--#include file="../include/keepHouse.asp"-->
<!--#include file="../include/header.asp"-->
<link href="../include/WebCourseSettlementStyle.Css" rel="stylesheet" type="text/css">
<%
dim ARRANGE_ID
ARRANGE_ID=request("ARRANGE_ID")
STUDENT_ID=Session("USER_NAME")
if ARRANGE_ID="" or Session("USER_TYPE")<>"Student" then
trigErr
end if
set Comd=server.createobject("ADODB.Command")
openDB
set Comd.ActiveConnection=conn
Comd.CommandType=adCMdStoredProc
Comd.CommandText="DetectSelectionCollision"
set Para1=Comd.CreateParameter("ARRANGE_ID",adInteger,adParamInput,4)
set Para2=Comd.CreateParameter("STUDENT_ID",adVarChar,adParamInput,20)
Comd.Parameters.Append Para1
Comd.Parameters.Append Para2
Comd("ARRANGE_ID") = ARRANGE_ID
Comd("STUDENT_ID") = STUDENT_ID
set rs1=Comd.execute
if not rs1.eof then //(26行在此!!)
response.write "<table width=70% border=1 cellspacing=0 align='center' "
response.write "cellpadding=0 bgcolor=#E2ECD1 "
response.write "bordercolordark=#FFFFFF bordercolorlight=#66ccff> "
response.write "<tr align='center'><td> "
response.write "<font size='+1' face='黑体' color='red'>该操作引起冲突:</font>"
response.write "</td></tr></table>"
'sql="select * from VIEW_Arrange where ARRANGE_ID="&ARRANGE_ID
'rs.open sql,conn,1,1
%>
<table width="70%" border="1" align="center" cellpadding="0" cellspacing="0"
bordercolorlight="#66ccff" bordercolordark="#FFFFFF" bgcolor="#F0F0F0">
<tr bgcolor=#99CCFF>
<td width="30%" bgcolor=#E2ECD1><strong>课程号</strong></td>
<td width="30%" bgcolor=#E2ECD1><strong>课程名</strong></td>
<td width="30%" bgcolor=#E2ECD1><strong>教师名</strong></td>
</tr>
<tr>
<td><font color=red><%=rs1("COURSE_ID")%></font></td>
<td><font color=red><%=rs1("COURSE_NAME")%></font></td>
<td><font color=red><%=rs1("TEACHER_NAME")%></font></td>
</tr>
</table>
<%
closeDB
response.Write "<A href='#' onclick=history.go(-1)><center>返回</center></a>"
%>
<!--#include file="../include/footer.asp"-->
<%
else
showmsg("选课成功!")
end if
%>
-------------------------------------------------------------------------------------------------------------------------------------------------
忘了说明一下,我用了一个名为DetectSelectionCollision的存储过程,目的是检测选课冲突.把存储过程的代码也贴上来:
create PROCEDURE DetectSelectionCollision
@ARRANGE_ID int,
@STUDENT_ID varchar(20)
AS
declare @DAY_TIME varchar(20)
declare @ARRANGE_ID_LOCAL int
--课程冲突:
select @ARRANGE_ID_LOCAL=ARRANGE_ID from CourseSelect
where ARRANGE_ID=@ARRANGE_ID and STUDENT_ID=@STUDENT_ID
--时间冲突:
select @DAY_TIME=DAY_TIME from Arrange
where ARRANGE_ID=@ARRANGE_ID
--select * from CourseSelect
--here DAY_TIME=@DAY_TIME
SELECT @ARRANGE_ID_LOCAL=CourseSelect.ARRANGE_ID
FROM Arrange INNER JOIN
CourseSelect ON
Arrange.ARRANGE_ID = CourseSelect.ARRANGE_ID
WHERE (Arrange.DAY_TIME = @DAY_TIME)
if @ARRANGE_ID_LOCAL<>''
select ARRANGE_ID,COURSE_ID,COURSE_NAME,TEACHER_NAME from VIEW_Arrange
where ARRANGE_ID=@ARRANGE_ID
else
begin
insert into CourseSelect values(@ARRANGE_ID,@STUDENT_ID)
select ARRANGE_ID from Arrange where ARRANGE_ID=0
end
GO
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-18 16:35 , Processed in 0.106027 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表