1. 首页
  2. 数据库
  3. 其它
  4. asp提示无效使用 Null: Replace

asp提示无效使用 Null: Replace

上传者: 2021-01-03 21:54:46上传 PDF文件 22.9KB 热度 16次
使用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),””) end if 测试: 代码如下:
下载地址
用户评论