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
热门推荐
2 红丝绒戚风蛋糕
3 夹心小甜点
4 南瓜甜点
6 粘米粉蒸蛋糕
7 酸奶华夫饼
9 红柚鸡蛋糕
10 葡萄干蛋糕
11 紫薯蛋糕卷
13 纸杯裱花小蛋糕
14 果酱奶酪蛋糕
15 日式樱花蔓越莓大福
16 草莓蛋糕卷
17 卡仕达长崎杯子蛋糕