调用GetFieldValue()函数时出错,如何解决,请教。进来有分。
我的程序段如下:
CRecordset m_set;
CString strSQL;
strSQL="select count(*) from table1";
m_set.Open(CRecordset::forwardOnly,_T(strSQL),CRecordset::readOnly);
CString str;
m_set.GetFieldValue((short)0,str);
int i=atoi(str);();//i为记录总数
但在调用GetFieldValue()函数时出错:错误提示为:Invalid Descriptor Index。为何?!