28,391
社区成员
发帖
与我相关
我的任务
分享
<!--#include file="conn.aspx"-->
<%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select isopen from webconfig",conn,1,1
if rs(0)=0 then
response.write "<H1 style=""BACKGROUND: #ccddff"">平台正在维护中</H1>"
response.write "<H2>This web site is under construction.</H2>"
response.end
end if
上面的代码在自己机子上运行正常,在服务器上那 if rs(0)=0 then 无论是rs(0)=0 还是rs(0)=1返回的都是true,打response.write "fdasf"&rs(0) 结果什么也没,打response.write "fdasf"结果是fdasf,感觉rs(0)这个很有问题,就是查不出来,也没提示错。本人不搞asp,帮人弄个网站遇到这种奇怪的事
<!--#include file="conn.aspx"-->
<%
set rs=server.CreateObject("adodb.recordset")
rs.Open "select top 1 isopen from webconfig",conn,1,1
If rs.EOF And rs.BOF Then
if rs.state<>0 then rs.close
conn.close
set rs = nothing
set conn = nothing
response.write "没记录"
response.end
Else
if rs(0).value=0 then
if rs.state<>0 then rs.close
conn.close
set rs = nothing
set conn = nothing
response.write "<H1 style=""BACKGROUND: #ccddff"">平台正在维护中</H1>"
response.write "<H2>This web site is under construction.</H2>"
response.end
end if
End If
if rs.state<>0 then rs.close
conn.close
set rs = nothing
set conn = nothing
%>