ADOTable2.Filter:='Cate_id='''+dxDBTreeList1.DataSource.DataSet.FieldByName('id').Value+'''';
错误提示:
could not convert variant of type string into type double
怎么转换?谢谢!!

解决方案 »

  1.   


    检查一下dxDBTreeList1.DataSource.DataSet.FieldByName('id').Value的值。
      

  2.   

    ADOTable2.Filter:='Cate_id='+dxDBTreeList1.DataSource.DataSet.FieldByName('id').asstring;
      

  3.   

    奇怪,Cate_id和id在表里都是int类型啊?
      

  4.   

    你要了解 Cate_id 这个是什么数据类型。
      

  5.   

    补充:
    Cate_id在你数据库里是double浮点数,
    dxDBTreeList1.DataSource.DataSet.FieldByName('id').Value
    的值有其他字符的话转换会出错。
      

  6.   

    既然是int 类型。那你就不应该搞那么多的引号。
      

  7.   

    could not convert variant of type string into type double整型?
    出错的是另外的语句吧