sql="select count(*) as geshu from table";
然后你看字段geshu的值

解决方案 »

  1.   

    我还是不太明白,那我表里要有geshu这个字段吗? 如何看它的值?
    能给出代码?
    谢谢飞哥!!留个qq号吧.
      

  2.   

    _variant_t vIndex=(long)0;
    _variant_t vCount=Rs1->GetCollect(vIndex);
    return vCount.lVal;
      

  3.   

    int i = m_pSet->GetCollect(_variant_t((long)0))
      

  4.   

    select count(*) aaa from table
    这个aaa是你随便起的,用时写出来就可以
      

  5.   

    odbc 里不是有 xxxFetch 吗?
      

  6.   

    问题解决!谢谢热心的朋友们!
    sql="select count(*) as geshu from tcp";
    m_pCommand->CommandText = sql.GetBuffer(0);
    Rs1=m_pCommand->Execute(&vNULL,&vNULL,adCmdText);
    _variant_t vCount=Rs1->GetCollect("geshu");
    iTcp=vCount.lVal;
    Rs1->Close();