使用TADOCommand 调用存储过程,其中有个'p_error_info'参数如下,command.Parameters.CreateParameter('p_error_info', ftString, pdOutput, 255, null);
  
调用后使用
sErrorInfo := command.Parameters.ParamValues['p_error_info'];
    得到结果时,出现invalid variant type conversion错误, 其中sErrorInfo 为String类型,请问错在那里啊。谢谢

解决方案 »

  1.   

    NULL转字符串出差,改成:sErrorInfo := VarToStrDef(command.Parameters.ParamValues['p_error_info'],'');
      

  2.   

    返回值是null就会报这个错误.
    先用varisempty判断一下.
      

  3.   

    delphi 5好像没有那个函数哦。 用的是delphi5版本。 怎么办哦
      

  4.   

    if not varisempty(command.Parameters.Parambyname['p_error_info'].value) then 
      MyoleVariant:=command.Parameters.Parambyname['p_error_info'].value;
      

  5.   

    恰好我用的也是D5
    System.pas   9874行  function VarIsEmpty(const V: Variant): Boolean;