Invalid variant type

场景:关于 invalid variant type conversion 异常

关于 invalid variant type conversion 错误
使用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类型,请问错在那里啊。

谢谢

------解决方案--------------------
NULL转字符串出差,改成:

sErrorInfo := VarToStrDef(command.Parameters.ParamValues[ 'p_error_info '], ' ');
------解决方案--------------------
if not varisempty(command.Parameters.Parambyname[ 'p_error_info '].value) then
MyoleVariant:=command.Parameters.Parambyname[ 'p_error_info '].value;
------解决方案--------------------
varToStr