我用的是ADOQuery,DBGrid,数据库是Access2003,OS是WinXP。
在我的ADOQuery(用来获取职工信息)中我new了一个Loopup字段,用来显示职工所属部门名称,通过用户选择部门名称来改变职工所属的部门编号,可以当我在程序运行起来,选择部门名称时,程序弹出如下的错误对话框:Project Project1.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type (OleStr) into type (Boolean)'. Process stopped. Use Step or Run to continue.这个问题怎么解决啊?
在我的ADOQuery(用来获取职工信息)中我new了一个Loopup字段,用来显示职工所属部门名称,通过用户选择部门名称来改变职工所属的部门编号,可以当我在程序运行起来,选择部门名称时,程序弹出如下的错误对话框:Project Project1.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type (OleStr) into type (Boolean)'. Process stopped. Use Step or Run to continue.这个问题怎么解决啊?
把adoquery中所有字段都清空,然后active一下,再添加你的lookup字段,lookup字段的lookupcache可以设置成true;