| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3119 人关注过本帖
标题:对象打开时,不允许操作
只看楼主 加入收藏
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
收藏
 问题点数:0 回复次数:11 
对象打开时,不允许操作

就是这段,看看~~
<%
SQL=""
SQL = SQL & "SELECT MAX(ESTIMATETIME) AS ESTIMATETIME FROM REQUIRE_ESTI Where IT_NO = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,1
ItWishTime = rs.fields("ESTIMATETIME")
if ItWishTime>"0" then%>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()" value="<%=rs("ESTIMATETIME")%>">
<%else%>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()">
<%rs.close%>
<% end if%>
搜索更多相关主题的帖子: SQL 对象 ESTIMATETIME input 
2007-10-11 09:36
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
你这是只能读取数据,不能对数据库进行操作的,如果依照你这个读取代码上再对数据进行操作,那你这个就要修改

Rs.open SQL,CONN,1,1 改成 Rs.open SQL,CONN,1,3

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-10-11 09:43
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
收藏
得分:0 
改了还是不行~~

学习ASP中.....难啊......
2007-10-11 09:52
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
代码都贴出来,错误提示是什么

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-10-11 09:57
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
应该是你在这段代码前面有打开过rs但是没有close吧,你找找看前面的代码

从BFS(Breadth First Study)到DFS(Depth First Study)
2007-10-11 10:08
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
收藏
得分:0 

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="include/public.css" type="text/css" rel="STYLESHEET">
<script src="../JsHtcCss/calendar.js" language="javascript"></script>
<script src="include/eoffice.js" language="javascript"></script>
<!--#Include File="../Top.ASP"-->
<title>资讯系统需求申请单</title>
<style>
.textbox { BORDER-TOP:#660000 2px solid; BORDER-LEFT:#660000 2px solid; BORDER-RIGHT:#CC0033 2px solid; BORDER-BOTTOM: #CC0033 2px solid; TEXT-ALIGN: LIFT;}
</style>
</head>
<% Response.Buffer=true %>
<%
If SESSION("UserId") = "" Then
Response.Redirect "/NewIT/Default.ASP"
End If
%>


<script language=javascript src="Include/setday.js"></script>
<!--#include file="Include/CheckStringLength.inc"-->
<!--#include file="Include/conn.inc"-->
<!--#include file="Include/adovbs.inc"-->
<%
Dim MaxId,tmpp
Dim rs,Sql
set rs=server.createobject("adodb.recordset")


%>
<%
Dim FLOWSN,MAJOR_IDEA,APPLY_DEPARTMENT,APPLIER,APPLY_TIME,WISH_FINISH_TIME,CODE
Dim OperType,OperYN,UserId
Dim NewOper
Dim err_msg
err_msg=""

UserId = Trim(SESSION("UserId"))
UserName = Trim(SESSION("username"))
FLOWSN = ""
FLOWSN = UCase(trim(request.querystring("OaID")))
If FLOWSN < " 0" Then
FLOWSN = request("FLOWSN")
End If
If FLOWSN > " 0" Then
OperType = true
Else
OperType = true
End If
OperYN = "N"
TOTESTTIME = ""
ItWishTime = ""
%>
<%
If OperType Then

SQL = ""
SQL = SQL & "SELECT * FROM songzw.Require_Bill Where FLOWSN = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,1
If rs.Eof and rs.Bof Then
Else
Rs.MoveFirst
If Rs.fields("APPLIER_ID") = "" then
ItUserId = ""
Else
ItUserId = Trim(Rs.fields("APPLIER_ID"))
End If
If Session("dutyid") < "110" Then
OperYN = "Y"
End If
'If UserName = "洪福亮" Then
' OperYN = "Y"
'End If
FLOWSN = Trim(Rs.fields("FLOWSN"))
BENEFIT = Trim(Rs.fields("BENEFIT"))
BENTFIT = Trim(Rs.fields("BENTFIT"))
BENMFIT = Trim(Rs.fields("BENMFIT"))
Problem = Trim(Rs.fields("Problem"))
Remark = Trim(Rs.fields("Remark"))
MAJOR_IDEA = Trim(Rs.fields("MAJOR_IDEA"))
APPLIER = Trim(Rs.fields("APPLIER"))
APPLY_TIME = Trim(Rs.fields("APPLY_TIME"))
WISH_FINISH_TIME = Trim(Rs.fields("WISH_FINISH_TIME"))
CODE = Trim(Rs.fields("CODE"))
IT_NO = Trim(Rs.fields("IT_NO"))
Apply_Department = Trim(Rs.fields("Apply_Department"))
RequireDate = Trim(Rs.fields("RequireDate"))
AnalysDate = Trim(Rs.fields("AnalysDate"))
CodeDate = Trim(Rs.fields("CodeDate"))
TestDate = Trim(Rs.fields("TestDate"))
Meno = Trim(Rs.fields("Meno"))
HANDLE_METHOD = Trim(Rs.fields("HANDLE_METHOD"))
AFFIRMTIME = Trim(Rs.fields("AFFIRMTIME"))
AffirmMeno = Trim(Rs.fields("AffirmMeno"))
AffirmType = Trim(Rs.fields("AffirmType"))
TOTESTTIME = Trim(Rs.fields("TOTESTTIME"))

Problem = Replace(Problem, Chr(0), " ")
Problem = Replace(Problem, Chr(10), " ")
Problem = Replace(Problem, Chr(13), " ")
Remark = Replace(Remark, Chr(0), " ")
Remark = Replace(Remark, Chr(10), " ")
Remark = Replace(Remark, Chr(13), " ")
End If
Rs.Close
End If

' SQL = ""
' SQL=SQL&"SELECT songzw.Require_Bill.TOTESTTIME, ss.ESTIMATETIME"
' SQL=SQL&" FROM songzw.Require_Bill INNER JOIN"
' SQL=SQL&" (SELECT IT_NO, MAX(ESTIMATETIME) AS ESTIMATETIME"
' SQL=SQL&" FROM REQUIRE_ESTI"
' SQL=SQL&" WHERE REQUIRE_ESTI.IT_NO = '" & FLOWSN & "'"
' SQL=SQL&" GROUP BY IT_NO) ss ON songzw.Require_Bill.FLOWSN = ss.IT_NO"
' Rs.open SQL,CONN,1,1
' ItWishTime = rs.fields("ESTIMATETIME")
' if ItWishTime>"0" then
' TOTESTTIME=ItWishTime
' else
' TOTESTTIME=Trim(Rs.fields("TOTESTTIME"))
' END IF
' Rs.Close

If request("flag")="M" then
TOTESTTIME = request("TOTESTTIME")
SQL = ""
SQL = SQL & "UPDATE songzw.Require_Bill "
SQL = SQL & "SET TOTESTTIME = '" & TOTESTTIME & "' Where FLOWSN = '" & FLOWSN & "'"
Conn.Execute(SQL)
' if ItUserID = "dsfa" then
if ItUserID <>"" then

set cneo=server.createobject("ADODB.CONNECTION")
strOracon = "Provider=MSDAORA.1; Persist Security Info=True;User ID=eosms; Password=eofficesms; Data Source=EOFFICE"
cneo.open strOracon
sysdate=date()
temprs = cneo.Execute("select EOFFICE.S_SY_MsgSend.nextval from dual")

subject = "需求单:" & MAJOR_IDEA & "-资讯承诺完成日期:" & TOTESTTIME
sql1="insert into EOFFICE.SY_MsgSend(MS_ID,ms_content,ms_sendtime,ms_type,ms_sender,MS_Status,MS_MsgSource) VALUES ("&temprs(0)&",'"& subject &"',sysdate,'1',1,1,2)"
cneo.execute(sql1)
sql2="insert into EOFFICE.SY_MsgReceiver(ms_id, mr_receiver, mr_mobileno, mr_type, mr_isread,mr_readdate) values ("&temprs(0)&",'" & ItUserID & "','','1',0,sysdate)"
cneo.execute(sql2)
end if
End If
%>
<!--
'洪福亮'2007年6月
-->
<body>
<form method="POST" name=frwrhs action="ItDateCheck.asp" >
<table border="1" align="center" width="90%" class="tableClass61" cellSpacing="0" cellPadding="0" bordercolor="#000000" bordercolorLight="#000000" bordercolorDark="#ffffff">
<td colspan="4" class="titleClass" >电子版资讯需求申请单承诺日期填写界面</td>
<tr>
<td>需求主旨 </td><td colspan="3"><input type="text" class="txtClass" id="MAJOR_IDEA" name="MAJOR_IDEA" size=65 maxlength=65 readonly style="color:#999999;width=90%"></td>
</tr>

<tr>
<td>需求编号</td><td><input type="text" class="txtClass" id="IT_NO" name="IT_NO" size=17 maxlength=17 readonly style="color:#999999"></td>
<td>需求单位</td><td><input type="text" class="txtClass" id="APPLY_DEPARTMENT" name="APPLY_DEPARTMENT" size=17 maxlength=17 readonly style="color:#999999"></td>
</tr>
<tr>
<td>需求提出人</td><td><input type="text" class="txtClass" id="APPLIER" name="APPLIER" size=17 maxlength=17 readonly style="color:#999999"></td>

<td>需求分类</td><td><input type="text" class="txtClass" id="CODE" name="CODE" size=17 maxlength=17 readonly style="color:#999999"></td>
</tr>
<tr>
<td>提出日期</td><td><input type="text" class="txtClass" id="APPLY_TIME" name="APPLY_TIME" size=17 maxlength=17 readonly style="color:#999999"></td>
<td>希望上线日</td><td><input type="text" class="txtClass" id="WISH_FINISH_TIME" name="WISH_FINISH_TIME" size=17 maxlength=17 readonly style="color:#999999"></td>
</tr>
<tr>
<td>效益说明 </td><td colspan="3"><input type="text" class="txtClass" id="BENEFIT" name="BENEFIT" size=65 maxlength=65 readonly style="color:#999999;width=90%"></td>
</tr>
<tr>
<td>效益工时(小时/年)</td><td><input type="text" class="txtClass" id="BENTFIT" name="BENTFIT" size=17 maxlength=17 readonly style="color:#999999"></td>
<td>效益金额(元/年)</td><td><input type="text" class="txtClass" id="BENMFIT" name="BENMFIT" size=17 maxlength=17 readonly style="color:#999999"></td>
</tr>
<tr><td height="24">效益附件</td>
<td colspan="3"><%
temid=split(selectid,", ")
for i=0 to UBound(temid)
conn.execute("delete from user_orders where goods='"&Trim(temid(i))&"'") '字符型
'conn.execute("delete from user_orders where goods="&Trim(temid(i))) '数字型
next
NewOper = ""
SQL = ""
SQL = SQL & "SELECT * FROM Require_deal Where ATTACH_TYPE = '6' And FLOWSN = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,1
I = 0
Do while Not rs.Eof
I = I + 1
If I > 1 then
response.write"<br>"
End If
str = "<a href="""& trim(rs.fields("ATTACH_NAME1")) &""" target='_blank'>" & trim(rs.fields("ATTACH_NAME")) & "</a>"
response.write str
Rs.MoveNext
Loop
Rs.Close
If I = 0 then
response.write "."
End If
%> </tr>
<tr>
<td rowspan="2">需求内容 </td><td colspan="3"><font style="font-size:8pt" >现有问题描述<br></font>
<textarea id=Problem name="Problem" rows=3 cols=100 Maxsize=300 readonly style="color:#999999"></textarea></td>
</tr>
<tr>
<td colspan="3"><font style="font-size:8pt" >未来作法或流程<br></font>
<textarea id=REMARK name="REMARK" rows=3 cols=100 Maxsize=300 readonly style="color:#999999"></textarea></td>
</tr>
<tr>
<td>用户需求文档(附件)</td>
<td colspan="3">
<% dim str
NewOper = ""
SQL = ""
SQL = SQL & "SELECT * FROM Require_deal Where ATTACH_TYPE = '1' And FLOWSN = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,1
I = 0
Do while Not rs.Eof
I = I + 1
If I > 1 then
response.write"<br>"
End If
str = "<a href='" & trim(rs.fields("ATTACH_NAME1")) & "' target='_blank'>" & trim(rs.fields("ATTACH_NAME")) & "</a>"
response.write str
Rs.MoveNext
Loop
Rs.Close
If I = 0 then
response.write "."
End If

%>
</td>
</tr>
<%
If OperType Then

SQL = ""
SQL = SQL & "SELECT * FROM REQUIRE_ESTI Where IT_NO = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,1
I = 0
J = 0
If Not rs.Eof Then
rs.movefirst
End If
Do while Not rs.Eof
I = I + 1
response.write""
If J = 1 then
tbgcolor="#FFFFFF"
J = 0
else
tbgcolor="#E9E9E9"
J = 1
End If
str = "<tr bgcolor=" & tbgcolor & "><td>评估人 </td><td>" & trim(rs.fields("EVALUATEMEMBER")) & "</td>"
response.write str
str = " <td>评估面 </td><td>" & trim(rs.fields("EVALUATETYPE")) & "</td></tr>"
response.write str
str = "<tr bgcolor=" & tbgcolor & "><td>预计投入工时</td><td>" & rs.fields("REQUIREHOUR") + rs.fields("ANALYSEHOUR") + rs.fields("CODEHOUR") + rs.fields("TESTHOUR") & "</td>"
response.write str
str = " <td>预计完成日期</td><td>" & trim(rs.fields("ESTIMATETIME")) & "</td></tr>"
response.write str

Rs.MoveNext
Loop
Rs.Close
If I > 0 then
SQL = ""
SQL = SQL & "SELECT SUM(REQUIREHOUR) AS REQUIREHOUR, SUM(ANALYSEHOUR) AS ANALYSEHOUR, "
SQL = SQL & " SUM(CODEHOUR) AS CODEHOUR, SUM(TESTHOUR) AS TESTHOUR, MAX(ESTIMATETIME) AS ESTIMATETIME "
SQL = SQL & "FROM REQUIRE_ESTI Where IT_NO = '" & FLOWSN & "' GROUP BY IT_NO"
Rs.open SQL,CONN,1,1
str = "<tr bgcolor=#FFFF00><td>预估总时数 </td><td>" & rs.fields("REQUIREHOUR") + rs.fields("ANALYSEHOUR") + rs.fields("CODEHOUR") + rs.fields("TESTHOUR") & "</td>"
response.write str
str = " <td>预计最后完成日期</td><td>" & rs.fields("ESTIMATETIME") & "</td></tr>"
response.write str
ItWishTime = rs.fields("ESTIMATETIME")
' if ItWishTime>"0" then
' TOTESTTIME=ItWishTime
' END IF
Rs.Close
End If


End If
%>
<tr>
我主要是针对这段进行修改就出错了
<%SQL=""
SQL = SQL & "SELECT MAX(ESTIMATETIME) AS ESTIMATETIME FROM REQUIRE_ESTI Where IT_NO = '" & FLOWSN & "'"
Rs.open SQL,CONN,1,3
ItWishTime = rs.fields("ESTIMATETIME")
if ItWishTime>"0" then%>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()" value="<%=rs("ESTIMATETIME")%>">
<%else%>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()">
<%rs.close%>
<% end if%>

<%
If TOTESTTIME > " 0" Then
Str = "<font style='font-size:8pt;color:#0000FF' >已承诺</font>"
Response.Write Str
Else
Str = "<font style='font-size:8pt;color:#0000FF' >主管未承诺</font>"
Response.Write Str
End If
%>
</td>
<%If OperYN = "Y" Then%>
<td align="center" colspan="2"><input type=button name="SaveRec" value=" 资讯承诺完成日期确认 " size=40>
<%Else%>
<td align="center" colspan="2"><input type=button name="SaveRec" value=" 资讯承诺完成日期确认 " size=40 disabled>
<%End If%>
</tr>
</table>
<br>
<table style="border: 1px solid black;BORDER-COLLAPSE:COLLAPSE" border="1" align="center" width="90%" class="tableClass61" cellSpacing="0" cellPadding="0" bordercolor="#000000" bordercolorLight="#000000" bordercolorDark="#ffffff">
<%
response.write"<tr>"
response.write"<td width=10% align=middle height=30 bgColor=#CCCCCC>需求主旨</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>需求单位</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>需求提出人</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>资讯承诺完成日期</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>资讯实际完成日期</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>IT访谈者</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>提出日期</td>"
response.write"<td width=10% align=middle bgColor=#CCCCCC>希望上线日期</td></tr>"
SQL = ""
' SQL = SQL & "SELECT * FROM songzw.Require_Bill Where (CodeDate > CONVERT(DATETIME, '1900-01-01 00:00:00', 102)) AND (Finish_Time IS NULL) and Apply_Department = '" & Apply_Department & "'"
' SQL = SQL & "SELECT * FROM songzw.Require_Bill Where FLOWSN > ' 00' and MAJOR_IDEA > ' 00'"
SQL = SQL & "SELECT * FROM songzw.Require_Bill Where (ITCheckFlag Like '%Y%') And FLOWSN > ' 00' and MAJOR_IDEA > ' 00' And Phase <> '用户提单' And Phase <> '用户主管审核' order by TOTESTTIME asc"
Rs.open SQL,CONN,1,3---------338行
Do while Not rs.Eof
response.write"<tr>"
str = "<a href='ItDateCheck.asp?OaID=" & rs.fields("FLOWSN") & "'>" & trim(rs.fields("MAJOR_IDEA")) & "</a>"
response.write"<td width=10% >" & str & "</td>"
response.write"<td width=10% >" & trim(rs.fields("APPLY_DEPARTMENT")) & "</td>"
response.write"<td width=10% >" & trim(rs.fields("APPLIER")) & "</td>"
Str = trim(rs.fields("TOTESTTIME"))
If Str > " 0" Then
Else
Str = "<font style='font-size:8pt;color:#00005F' >未承诺</font>"
End If

response.write"<td width=10% >" & Str & "</td>"
response.write"<td width=10% >" & trim(rs.fields("TestDate")) & "</td>"
response.write"<td width=10% >" & trim(rs.fields("IT_UNDERTAKER")) & "</td>"
response.write"<td width=10% >" & trim(rs.fields("APPLY_TIME")) & "</td>"
response.write"<td width=10% >" & trim(rs.fields("WISH_FINISH_TIME")) & "</td></tr>"
Rs.MoveNext
Loop
%>
</TABLE>


<p><input type=hidden name=flag value=""><input type=hidden name=FLOWSN value=""></p>
</form>
</body>
<%
set Rs = nothing
set CONN = nothing
Problem = Replace(Problem, Chr(0), " ")
Problem = Replace(Problem, Chr(10), " ")
Problem = Replace(Problem, Chr(13), " ")
Remark = Replace(Remark, Chr(0), " ")
Remark = Replace(Remark, Chr(10), " ")
Remark = Replace(Remark, Chr(13), " ")

%>
</html>

<script language=vbscript>

frwrhs.FLOWSN.value ="<%=FLOWSN%>"
frwrhs.IT_NO.value ="<%=IT_NO%>"
frwrhs.MAJOR_IDEA.value ="<%=MAJOR_IDEA%>"
frwrhs.APPLY_DEPARTMENT.value ="<%=APPLY_DEPARTMENT%>"
frwrhs.APPLIER.value ="<%=APPLIER%>"
frwrhs.CODE.value ="<%=CODE%>"
frwrhs.APPLY_TIME.value ="<%=APPLY_TIME%>"
frwrhs.WISH_FINISH_TIME.value ="<%=WISH_FINISH_TIME%>"
frwrhs.BENEFIT.value ="<%=BENEFIT%>"
frwrhs.BENTFIT.value ="<%=BENTFIT%>"
frwrhs.BENMFIT.value ="<%=BENMFIT%>"
frwrhs.Problem.value ="<%=Problem%>"
frwrhs.REMARK.value ="<%=REMARK%>"
frwrhs.TOTESTTIME.value ="<%=TOTESTTIME%>"

</script>
<script language=vbscript>
'查询

sub SaveRec_onclick

if frwrhs.TOTESTTIME.value="" then
msgbox "资讯承诺完成日期不能为空",48, "资讯系统需求单确认"
frwrhs.TOTESTTIME.focus
exit sub
end if
if frwrhs.MAJOR_IDEA.value="" then
msgbox "您还没有选择需要确认的需求单",48, "资讯系统需求单确认"
frwrhs.MAJOR_IDEA.focus
exit sub
end if

CheckTrue=msgbox("您确认“" & frwrhs.MAJOR_IDEA.value & "”预计完成日期吗?",vbYesNo,"日期确认")
If CheckTrue = 6 then
frwrhs.flag.value = "M"
frwrhs.submit
End If
end sub
</script>

ADODB.Recordset 错误 '800a0e79'
对象打开时,不允许操作。

/NewIT/hfl/ItDateCheck.asp,行 338


学习ASP中.....难啊......
2007-10-11 10:10
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
你的橙色那段,最后面的
<%rs.close%>
<% end if%>
两句换个位置

从BFS(Breadth First Study)到DFS(Depth First Study)
2007-10-11 10:31
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
收藏
得分:0 

对调了是不会报错了,但是功能也不能实现了

我本来要想实现的是
ItWishTime = rs.fields("ESTIMATETIME")
如果数据库中的 ESTIMATETIME 不为空的话就显示在TOTESTTIME
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()" value="<%=rs("ESTIMATETIME")%>">

就是说TOTESTTIME框内默认的就是rs.fields("ESTIMATETIME")的值,也可以进行修改


学习ASP中.....难啊......
2007-10-11 11:44
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
if ItWishTime>"0" then
这句是什么作用?不为空应该是ItWishTime<>""

之所以要两句的位置对调,是为了无论if的条件如何,都能执行到rs.close这一句,这个跟实现你需要的功能不冲突

你原来那样,如果满足了if的条件,rs.close这句就不能被执行到,下面如果再次有rs.open的话,就肯定会出错了

从BFS(Breadth First Study)到DFS(Depth First Study)
2007-10-11 12:07
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
收藏
得分:0 

永夜的极光你说的对,我明白了,我现在改成这样

<%
SQL=""
SQL=SQL&" SELECT songzw.Require_Bill.TOTESTTIME, ss.ESTIMATETIME"
SQL=SQL&" FROM songzw.Require_Bill INNER JOIN"
SQL=SQL&" (SELECT IT_NO, MAX(ESTIMATETIME) AS ESTIMATETIME"
SQL=SQL&" FROM REQUIRE_ESTI"
SQL=SQL&" WHERE REQUIRE_ESTI.IT_NO = '" & FLOWSN & "'"
SQL=SQL&" GROUP BY IT_NO) ss ON songzw.Require_Bill.FLOWSN = ss.IT_NO"
Rs.open SQL,CONN,1,3
TOTESTTIME=rs.fields("TOTESTTIME")------------309行
If TOTESTTIME <> "" then
%>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()">
<% else %>
<td>资讯承诺完成日期</td><td><input type="text" class="textbox" id="TOTESTTIME" name="TOTESTTIME" size=17 maxlength=17 onFocus="calendar()" value="<%=rs.fields("ESTIMATETIME")%>">
<% end if %>
<%rs.close%>

ADODB.Field 错误 '800a0bcd'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/NewIT/hfl/ItDateCheck.asp,行 309

TOTESTTIME的值在数据库中有可能是空值,所以会出现这样的错误,可是我不知道该怎么改,才对呢


学习ASP中.....难啊......
2007-10-11 13:30
快速回复:对象打开时,不允许操作
数据加载中...
 
   



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

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