我在运行Delphi7时出现了错误有哪位能帮忙解决这个问题吗?下面是系统出错提示:   
  project   gzxt_project1.exe   raised   exception   class   EVariant   TypeCastError   with   message'Could   not   connert   variant   of   type   (Null)   into   type(String)'.Process   stopped.Use   step   or   Run   to   continue! 
希望大家帮帮忙,先谢了!急呀

解决方案 »

  1.   

    connert variant of type (Null) into type(String)
    好好查查代码,类型转换错误呀!!
      

  2.   

    类型转换错误,某个值返回是null,null赋给string类型出错。写个函数处理一下:
    function GetValue(value: variant): variant;
    begin
      if value=null then result := Unassigned
      else result := value;
    end;
      

  3.   

    类型转换错误啊,我也遇到过的,把variant类型的转换string类型就行了,用VarToStrDef函数进行转换就可以了。
      

  4.   

    所有的转换函数都用XXXDef的,不会抛出异常。而且会有默认值的。