加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

无效使用 Null: 'Replace'

发布时间:2023-09-07 11:06:16 所属栏目:Asp教程 来源:
导读:使用REPLACE来将数据库里读出来的数据替换,如果字段不为空是正常,但如果为空时就出现以下提示:

Microsoft VBScript 运行时错误 错误 '800a005e'

无效使用 Null: 'Replace'

主要问题就是sql
使用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

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章