ADO问题?????

chenyuandxm 2003-10-15 05:54:44
我建立了一个窗体,之前运行正常,但是加入一个ADOTable连接到SQL的Table时
一运行就出现以下的错误,
Project communication.exe raised exception class EVariantError
with message'Invalid variant type conversion'.Process stopped.
Use Step or Run to continue.
请各位帮忙解决:
...全文
32 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
gmc007 2003-10-16
  • 打赏
  • 举报
回复
Project communication.exe raised exception class EVariantError
with message'Invalid variant type conversion'.Process stopped.
Use Step or Run to continue.
-----------
这个错误经常是由于一个字符串和NULL相加引起的。
xchonglfm 2003-10-16
  • 打赏
  • 举报
回复
adotable1.filter:='tname='+''''+edit1.Text+'''';
njlindy 2003-10-16
  • 打赏
  • 举报
回复
给adotable添加永久字段,好像表里有记录的字段为空时会出现上面的错误
chenyuandxm 2003-10-16
  • 打赏
  • 举报
回复
with ADOTable1 do
begin
active:=true;
adotable1.Filtered:=true;
adotable1.filter:='tname='''+edit1.Text+'''';
adotable1.Filtered:=false;
可不可以这样用?
guojingui 2003-10-16
  • 打赏
  • 举报
回复
with ADOTable1 do
begin
active:=false;
adotable1.Filtered:=false;
adotable1.filter:='tname='''+edit1.Text+'''';
adotable1.Filtered:=true;
active:=true;
这样试一试应该可以的
angle097113 2003-10-16
  • 打赏
  • 举报
回复
adotable1.filter:='tname='''+edit1.Text+'''' 这句话有问题的

with ADOTable1 do
begin
active:=False;
adotable1.filter:='tname='+edit1.Text;
adotable1.Filtered:=true;
试试!
angle097113 2003-10-15
  • 打赏
  • 举报
回复
adotable里面肯定是要有语句的
chenyuandxm 2003-10-15
  • 打赏
  • 举报
回复
没有语句,我只是把ADOtable的属性connectionstring和tablename设了一下,就出现上面的错误。
angle097113 2003-10-15
  • 打赏
  • 举报
回复
类型的转换错把tabke的语句铁处来看看

2,496

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧