asp连接oracle,在 movenext 时才出错 80004005

本文分享了一次程序运行异常的经历,通过重新分配Windows TEMP文件夹的访问和修改权限给IUSER,成功解决了问题。提醒开发者注意权限设置对程序运行的影响。

程序之前能正常使用,不知道为什么突然不行了

查了一大堆文章,都没解决

后来想想,是执行过一个BAT,清除日志,打开看看,发现里面有个删除 windows 下 temp文件夹的操作

好象以前对这个文件夹做过什么操作的

然后把temp文件夹的访问、修改权限加给IUSER,故障解决

<script language="JavaScript"> <!-- javascript:window.history.forward(1); //--> </script> <style type="text/css"> <!-- body { background-image: url(images/11-07.gif); } .style2 { font-family: "黑体"; font-size: 20px; } .style4 { font: lighter bold 12px "Arial", "Helvetica", "sans-serif"; color: #333333; } --> </style> <html> <link href="images/cssexamin.css" rel="stylesheet" type="text/css"> <title>考试成绩信息</title> <% Set conn=server.createObject("ADODB.Connection") strconnection="DRIVER={microsoft odbc for oracle};SERVER=//10.224.141.134:1521/FP2DB;UID=f2cim;PWD=eagle;" conn.open strconnection function sqlstr(data) sqlstr="'" & replace(data,"'","''") & "'" end function %> <body class="banquan" background="images/11-07.gif"> <div id="layertitle" style="position:absolute; width:100%; height:300px; z-index:2; top: 1px;"> <% Dim sqlMain sqlMain = " WITH table1 AS ( " & _ " SELECT DISTINCT no, eqptype, diff " & _ " FROM certify_tb_3monthlimit " & _ " WHERE no LIKE '%V%' AND diff > '60' " & _ " ), table2 AS ( " & _ " SELECT DISTINCT a.eqptype, b.item " & _ " FROM certify_tb_type_mapping a " & _ " JOIN certify_tb_item_mapping b ON a.objid = b.objid " & _ " ), table3 AS ( " & _ " SELECT DISTINCT a.empno, b.COURSE_NAME " & _ " FROM mfg_tb_newtraining_final_result a " & _ " JOIN mfg_tb_newtraining_course b ON a.COURSE_ID = b.COURSE_ID " & _ " WHERE a.WR_CERTIFY = '1' " & _ " AND a.GROUP_NAME <> 'Basic' " & _ " AND a.empno LIKE '%V%' " & _ " ) " & _ " SELECT DISTINCT a.no, b.item " & _ " FROM table1 a " & _ " JOIN table2 b ON a.eqptype = b.eqptype " & _ " JOIN table3 c ON b.item = c.COURSE_NAME AND a.no = c.empno " Dim rsMain Set rsMain = conn.Execute(sqlMain) If Not rsMain.EOF Then Do While Not rsMain.EOF Dim noValue, itemValue noValue = rsMain("no") itemValue = rsMain("item") ' 更新 mfg_tb_newtraining_final_result 表 Dim sqlUpdate sqlUpdate = " UPDATE mfg_tb_newtraining_final_result " & _ " SET WR_CERTIFY = '0' " & _ " WHERE empno = '" & noValue & "' " & _ " AND COURSE_ID IN ( " & _ " SELECT COURSE_ID " & _ " FROM mfg_tb_newtraining_course " & _ " WHERE COURSE_NAME = '" & itemValue & "' " & _ " ) " On Error Resume Next conn.Execute(sqlUpdate) If Err.Number <> 0 Then Response.Write "更新失败: " & noValue & " - " & itemValue & ",错误: " & Err.Description & "<br/>" Err.Clear Else Response.Write "更新成功: " & noValue & " - " & itemValue & "<br/>" End If On Error GoTo 0 rsMain.MoveNext Loop Else Response.Write "没有符合条件的数据需要更新。<br/>" End If rsMain.Close Set rsMain = Nothing %> </div> </body> </html> 这个代码再执行在 76行报 对象关闭无法操作
10-30
<script language="JavaScript"> <!-- javascript:window.history.forward(1); //--> </script> <style type="text/css"> <!-- body { background-image: url(images/11-07.gif); } .style2 { font-family: "黑体"; font-size: 20px; } .style4 { font: lighter bold 12px "Arial", "Helvetica", "sans-serif"; color: #333333; } --> </style> <html> <link href="images/cssexamin.css" rel="stylesheet" type="text/css"> <title>考试成绩信息</title> <% Set conn=server.createObject("ADODB.Connection") strconnection="DRIVER={microsoft odbc for oracle};SERVER=//10.224.141.134:1521/FP2DB;UID=f2cim;PWD=eagle;" conn.open strconnection function sqlstr(data) sqlstr="'" & replace(data,"'","''") & "'" end function %> <body class="banquan" background="images/11-07.gif"> <div id="layertitle" style="position:absolute; width:100%; height:300px; z-index:2; top: 1px;"> <% Dim sqlMain sqlMain = " WITH table1 AS ( " & _ " SELECT DISTINCT no, eqptype, diff " & _ " FROM certify_tb_3monthlimit " & _ " WHERE no LIKE '%V%' AND diff > '60' " & _ " ), table2 AS ( " & _ " SELECT DISTINCT a.eqptype, b.item " & _ " FROM certify_tb_type_mapping a " & _ " JOIN certify_tb_item_mapping b ON a.objid = b.objid " & _ " ), table3 AS ( " & _ " SELECT DISTINCT a.empno, b.COURSE_NAME " & _ " FROM mfg_tb_newtraining_final_result a " & _ " JOIN mfg_tb_newtraining_course b ON a.COURSE_ID = b.COURSE_ID " & _ " WHERE a.WR_CERTIFY = '1' " & _ " AND a.GROUP_NAME <> 'Basic' " & _ " AND a.empno LIKE '%V551773%' " & _ " ) " & _ " SELECT DISTINCT a.no, b.item " & _ " FROM table1 a " & _ " JOIN table2 b ON a.eqptype = b.eqptype " & _ " JOIN table3 c ON b.item = c.COURSE_NAME AND a.no = c.empno " Response.Write "SQL: " & sqlMain & "<br/>" Set rsMain = conn.Execute(sqlMain) If Not rsMain.EOF Then Do While Not rsMain.EOF Dim noValue, itemValue noValue = rsMain("no") itemValue = rsMain("item") ' 更新 mfg_tb_newtraining_final_result 表 Dim sqlUpdate sqlUpdate = " UPDATE mfg_tb_newtraining_final_result " & _ " SET WR_CERTIFY = '0' " & _ " WHERE empno = '" & noValue & "' " & _ " AND COURSE_ID IN ( " & _ " SELECT COURSE_ID " & _ " FROM mfg_tb_newtraining_course " & _ " WHERE COURSE_NAME = '" & itemValue & "' " & _ " ) " On Error Resume Next conn.Execute(sqlUpdate) If Err.Number <> 0 Then Response.Write "更新失败: " & noValue & " - " & itemValue & ",错误: " & Err.Description & "<br/>" Err.Clear Else Response.Write "更新成功: " & noValue & " - " & itemValue & "<br/>" End If On Error GoTo 0 rsMain.MoveNext Loop Else Response.Write "没有符合条件的数据需要更新。<br/>" End If rsMain.Close Set rsMain = Nothing %> </div> </body> </html> 我现在该了 你在检查一下
最新发布
10-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值