asp提示无效使用 Null: Replace
使用REPLACE来将数据库里读出来的数据替换,如果字段不为空是正常,但如果
为空时就出现以下提示:
MicrosoftVBScript运行时错误错误'800a005e'
无效使用Null:'Replace'
主要问题就是sqlserver的字段为null,所以不能简单的为空判断,只能使用isnull
可以先判断
ifisnull(rs("coutent"))=falsethen
response.write("null")
else
response.writereplace(rs("coutent"),chr(13),"<br/>")
endif
测试:
ifisnull(keyword)=truethenkeyword=dxy_title ifisnull(descriptions)=truethendescriptions=dxy_title
热门推荐
10 小红书平安祝福语简短
11 生日祝福语大全女孩简短
12 收生日红包祝福语 简短
13 领证幽默祝福语简短
14 法考面试祝福语简短
15 老哥出门祝福语简短语
16 送灯祝福语简短独特
17 幼儿狗年祝福语大全简短
18 好听的元旦简短祝福语