aspcms免费开源企业网站开发建设管理系统源码程序

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3267|回复: 0

asp提示无效使用 null: replace

[复制链接]

187

主题

188

帖子

609

积分

高级会员

Rank: 4

积分
609
发表于 2021-5-1 22:13:21 | 显示全部楼层 |阅读模式
使用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
回复

使用道具 举报

*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|aspcms免费开源企业网站开发建设管理系统源码程序 ( 冀ICP备17022052号-2|网站地图

GMT+8, 2024-4-28 23:59 , Processed in 0.031909 second(s), 19 queries .

Powered by aspcms免费开源企业网站开发建设管理系统源码程序

© 2001-2025 aspcms免费开源企业网站开发建设管理系统源码程序

快速回复 返回顶部 返回列表