怎么不能返回count值
STDMETHODIMP Caa::get_Count(long *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
_RecordsetPtr spRS;
long lcnt;
try{
OpenConnection();
MYCREATEINSTANCE(spRS,Recordset);
spRS->CursorLocation = adUseClient;
spRS->putref_ActiveConnection(m_spConn);
char buf[99];
sprintf(buf,"SELECT count(*) as cnt FROM taa");
spRS->Open(_variant_t(buf),vtMissing,adOpenStatic,adLockBatchOptimistic,-1);
spRS->PutRefActiveConnection(NULL);// Disassociate the connection from the recordset.
m_spConn->Close();
lcnt= spRS->Fields("cnt");
*pVal=lcnt;
spRS->AddRef();
}
catch( _com_error &e){
ERR_MSG(e,"get_Count");
}
return S_OK;
}
我的目的是返回count值,怎么返回不了?
error C2064: term does not evaluate to a function