急问:replace 无效使用 Null的原因,先谢了!

skyflcat 2004-09-21 10:31:21
程序代码如下:

for each x in RSspan.Fields
strLine= strLine & replace(x.value,";",".") & chr(9)
next

,可为什么每次总是提示:

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

无效使用 Null: 'replace'

/amtsystem/tj_te/exeQueryTJAMTCTR.asp,行100


请指点,谢谢!
...全文
238 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
shi97521601 2004-10-22
  • 打赏
  • 举报
回复
若是日期类型的字段为空提示该错误,怎么办呢?
lxcc 2004-09-21
  • 打赏
  • 举报
回复
代码写的快,但是运行不见得快!因为类型转换也是很浪费时间的!
iif肯定比if浪费时间!
所以绿豆的方法是最标准的方法!
hantaocn 2004-09-21
  • 打赏
  • 举报
回复
三个方法那个最快呢???个人感觉是 lxcc的
ryuginka 2004-09-21
  • 打赏
  • 举报
回复
或者用IIF函数也可以
for each x in RSspan.Fields

strLine= strLine & replace(iif(isnull(x.value),"",x.value),";",".") & chr(9)

next
hxy2003 2004-09-21
  • 打赏
  • 举报
回复
呵呵。。。
supergreenbean 2004-09-21
  • 打赏
  • 举报
回复
555~``,30分都跟我抢,没天理了阿~~~
superxiumu 2004-09-21
  • 打赏
  • 举报
回复
for each x in RSspan.Fields
if not isnull(x.value) then
strLine= strLine & replace(x.value,";",".") & chr(9)
end if
next
脆皮大雪糕 2004-09-21
  • 打赏
  • 举报
回复
没啥可抢的了 :(
lxcc 2004-09-21
  • 打赏
  • 举报
回复
抢绿豆点分 :D

for each x in RSspan.Fields
strLine= strLine & replace("" & x.value,";",".") & chr(9) '这样也行!
next
supergreenbean 2004-09-21
  • 打赏
  • 举报
回复
x.value的值是null


for each x in RSspan.Fields
if not isnull(x.value) then
strLine= strLine & replace(x.value,";",".") & chr(9)
end if
next

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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