with ADOTable1 do
begin
active:=true;
adotable1.Filtered:=false;
adotable1.filter:='tname='''+edit1.Text+'''';
adotable1.Filtered:=true;
可不可以这样用?

解决方案 »

  1.   

    ADOTable用于用ado控件连接的数据库,Table用于bde连接的数据库。
    功能一样,用法也一样。如果不通,是这个语句的问题:adotable1.filter:='tname='+''''+edit1.Text+'''';
      

  2.   

    但是一运行就出现以下的错误,
    Project communication.exe raised exception class EVariantError
    with message'Invalid variant type conversion'.Process stopped.
    Use Step or Run to continue.
    这是怎么回事。
    我试了新建一个窗体什么控件也没加只加了一个ADOTable控件,设了它的connectstring和adotablename属性运行时也会出现上面的错误,到底怎么回事?????
      

  3.   

    with ADOTable1 do
    begin
    active:=true;
    adotable1.Filtered:=false;
    adotable1.filter:='tname='+edit1.Text;
    adotable1.Filtered:=true;
    end;
    这样是正确的!
     :)
      

  4.   

    正确的
    看看是不是你的delphi有问题了
      

  5.   

    类型转换错误
    with ADOTable1 do
    begin
    active:=true;
    adotable1.Filtered:=false;
    adotable1.filter:='tname='+edit1.Text;
    adotable1.Filtered:=true;
    end;
    应该把你的那些引号去掉的
      

  6.   

    重新启动以后能运行了,但是当在edit1中输入tname以后,点确定还是出现同样的错误,program reset后光标指向adotable1.Filtered:=false;