是字符类型吗,用COleVariant吧!

解决方案 »

  1.   

    类型错误:
    temp2应定义为CDBVariant型,如下:
    CDBVariant var;
    pBT.GetFieldValue("Smoney",var);
    然后可以把var转换为其它类型
      

  2.   

    字段code是varchar型
    字段money是bigint如果sum(money)改成money编译通过.
      

  3.   

    我知道什么原因了。要按顺序。
    select sum(money) as Smoney,code
    from 表
    group by code
    ------------------
    CString temp1,temp2;
    pBT.GetFielsValue("Smoney",temp1);
    pBT.GetFielsValue("code",temp2);
    编译通过
      

  4.   

    用COleVariant,然后再进行转换好了