灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:9896回复:0

asp提示无效使用 Null: Replace

楼主#
更多 发布于:2014-12-21 15:20
使用REPLACE来将数据库里读出来的数据替换,如果字段不为空是正常,但如果
为空时就出现以下提示:
Microsoft VBScript 运行时错误 错误 '800a005e'
无效使用 Null: 'Replace'
主要问题就是sqlserver的字段为null,所以不能简单的为空判断,只能使用isnull
可以先判断
if isnull(rs("coutent"))=false then
response.write("null")
else
response.write replace(rs("coutent"),chr(13),"<br/>")
end if
测试:
 
代码如下:

if isnull(keyword)=true then keyword=dxy_title
if isnull(descriptions)=true then descriptions=dxy_title

喜欢0 评分0
游客

返回顶部