无效的描述符索引

for(int i= 0;i<m_recordSet.GetRecordCount();i++)
{
CString temp1,temp2,temp3,temp4,temp5,temp6;
m_recordSet.GetFieldValue("MeterialName",temp1);
m_recordSet.GetFieldValue("MeterialAmount",temp2);
m_recordSet.GetFieldValue("MeterialDate",temp3);
m_recordSet.GetFieldValue("StorageName",temp4);
m_recordSet.GetFieldValue("StaffName",temp5);
m_recordSet.GetFieldValue("DepartmentName",temp6);

我调试,发现运行到m_recordSet.GetFieldValue("MeterialName",temp1);
就出错了,说是无效的描述符索引。
大虾们帮帮忙

作者: yalbe456   发布时间: 2011-06-15

数据库中不存在“MeterialName”字段?

作者: shenyi0106   发布时间: 2011-06-15

引用 1 楼 shenyi0106 的回复:
数据库中不存在“MeterialName”字段?
有啊,我插入数据进去都可以的

作者: yalbe456   发布时间: 2011-06-15

第一个就挂了啊,你的m_recordSet是有效的么?

作者: kyotrue   发布时间: 2011-06-15

引用 3 楼 kyotrue 的回复:
第一个就挂了啊,你的m_recordSet是有效的么?
头文件中有:
public:
CSQLSet m_recordSet;
CDatabase m_database;
CStorageOut(CWnd* pParent = NULL);

作者: yalbe456   发布时间: 2011-06-15