程序代码如下: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 
。请指点,谢谢!

解决方案 »

  1.   

    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
      

  2.   

    抢绿豆点分 :Dfor each x in RSspan.Fields
     strLine= strLine & replace("" & x.value,";",".") & chr(9)  '这样也行!
     next
      

  3.   

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

  4.   

    或者用IIF函数也可以
    for each x in RSspan.Fields
      
         strLine= strLine & replace(iif(isnull(x.value),"",x.value),";",".") & chr(9)
      
    next
      

  5.   

    三个方法那个最快呢???个人感觉是 lxcc的
      

  6.   

    代码写的快,但是运行不见得快!因为类型转换也是很浪费时间的!
    iif肯定比if浪费时间!
    所以绿豆的方法是最标准的方法!