if语句中有多个条件与该怎么写?

showfray 2003-03-19 11:33:45
if rs("a")=1 and rs("b")=1 and rs("c")=1 then
response.write "abc"
else
response.write "Error!"
end if
就以上句子出错,应如何改写if条件语句?
...全文
1344 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ChaoHan 2003-03-19
  • 打赏
  • 举报
回复
得到的rs记录集是否为空啊?

response.write rs.recordcount 看看是不是大于0!
supreme 2003-03-19
  • 打赏
  • 举报
回复
先把rs("a"),rs("b"),rs("c")賦值給變量a,b,c
然後再

if (a=1) and (b=1) and (c=1) then
response.write "abc"
else
response.write "Error!"
end if
itperson 2003-03-19
  • 打赏
  • 举报
回复
加上括号试试//我没试过

if (rs("a")=1) and (rs("b")=1) and (rs("c")=1) then
response.write "abc"
else
response.write "Error!"
end if
antiking 2003-03-19
  • 打赏
  • 举报
回复
打开记录集
判断有没有记录。
if rs.recordcount > 0 then
if rs("a")=1 and rs("b")=1 and rs("c")=1 then
response.write "abc"
else
response.write "Error!"
end if
else
....
end if
muxinpp 2003-03-19
  • 打赏
  • 举报
回复
rs("a");rs("b");rs("c")得到的值可能是空也可能是字符串,你最好还要判断一下!
GageCSDN 2003-03-19
  • 打赏
  • 举报
回复
If语句没有错,是不是rs中没有记录或没有Open??
showfray 2003-03-19
  • 打赏
  • 举报
回复
if rs("a")=1 and rs("b")=1 and rs("c")=1 then
response.write "abc"
else
response.write "Error!"
end if
就以上句子出错,应如何改写if条件语句?

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧