相同的数据库结构,在SQL SERVER2000中一切正常,可是到ACCESS出现问题:
错误信息:
project project1.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type(NULL) into type(String)'.process stopped但是可以建立工程,.EXE文件运行也没什么问题,请问这是为什么,程序比较长,不方便贴出源码
错误信息:
project project1.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type(NULL) into type(String)'.process stopped但是可以建立工程,.EXE文件运行也没什么问题,请问这是为什么,程序比较长,不方便贴出源码
这是错误提示,你看看你的程序中是否有类似的赋值处理呢?
var
s:string;
s:=adoquery1.fieldbyname('Fieldname').value;{variant----->string}//---隐式转换
改成这样的:
s:=trim(adoquery1.fieldbyname('fieldname').asstring);//---显式转换
begin
//可以赋值
end else
begin
//不能赋值,需要另想办法
end;
//you can't
else
//you can
//you can't
else
//you can