无效使用 Null: 'replace' 为什么

zbulrush 2003-06-10 10:37:53
Microsoft VBScript 运行时错误 错误 '800a005e'

无效使用 Null: 'replace'

/2003/fangchan/inc_xsjy002.asp, 行114
代码如下:
standard=rs("standard")
if standard="" then
response.write ""
else
standard=replace(standard,chr(13),"<br>")
response.write standard -----行114
end if

要是把114行注释掉,问题就能正确输出,就是不自动换行,但是一用replace就出错,为什么?
...全文
125 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwfwww 2003-06-10
  • 打赏
  • 举报
回复
那是因为你的变量standard的值为null 改为这样就行了
if standard="" or isnull(standard) then
response.write ""
else
standard=replace(standard,chr(13),"<br>")
response.write standard -----行114
end if
gq 2003-06-10
  • 打赏
  • 举报
回复
在从数据库读standard的时候:把standard改为isnull(standard,'')

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧