菜鸟:在VC中如何获得符合条件的记录数
LONG count;
CString sqlout;
sqlout = " SELECT count(*) AS cc FROM TCMSTL301 WHERE Slab_Num = '123'";
m_pRstout_Star = m_ADOConn.GetRecordSet((_bstr_t)sqlout) ;
count = m_pRstout_Star->RecordCount;
我这样写结果count = -1,哪里错了呢?
------解决方案--------------------
sql语句SELECT count(*) AS cc FROM TCMSTL301 WHERE Slab_Num = '123'是没有任何问题的。