我使用delphi7.0,在编程中用到adotable,有语句
  adotable1.actived:=false;
    adotable1.tablename:='dw';
    aodtable1.actived:=true;
但执行时有错误
could not covert variant of type(null) into type(string) process stopped use step or run to continue.
换成adoquery1是问题正确,数据库换成acess是也正确。
我的表中有无记录都不能使用aodtable1.
如果在设计时将actived置为true数据都显示,但不能执行

解决方案 »

  1.   

    试试:
    adotable1.actived:=false;
        adotable1.tablename:=''dw'';
        aodtable1.actived:=true;
      

  2.   

    改为''dw''不成,查connection,查些什么呢,我用的是odbc,connectstring是
    Provider=MSDASQL.1;Persist Security Info=False;Data Source=hello;Initial Catalog=hello;
    但换成
    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hello;Data Source=.
    就没有问题了,即就是不能使用odbc