这是一个数据保存到表里的代码
void CSendDIN::Onsave() 
{
// TODO: Add your control notification handler code here
CString grade;
grade.Format("%d",m_ggrade);
UpdateData(true);
    if ( (AfxMessageBox("是否要保存数据  " , MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2)) == IDYES )
{
if(m_gid.IsEmpty())
{
AfxMessageBox("请输入学生学号!");
return;
}
else if(m_gsubject.IsEmpty())
{
AfxMessageBox("请输入课程名!");
return;
}
else if(grade.IsEmpty())
{
AfxMessageBox("请输入成绩!");
return;
}
pSet->AddNew();
pSet->m_ID=m_gid;
pSet->m_name=m_gname;
pSet->m_subject=m_gsubject;
pSet->m_grade=m_ggrade;
pSet->Update();
pSet->Requery();

AfxMessageBox("数据已经正确保存!");
}
}
前面我已经定义了CSendDIN* pSet;(CSendDIN的基类为CRecordSet)
但编译是出现一大堆错误:
'CSendSet' : missing storage-class or type specifiers
'pSet' : missing storage-class or type specifiers
'pSet' : undeclared identifier
left of '->m_ID' must point to class/struct/union
left of '.IsEmpty' must have class/struct/union type
left of '->m_name' must point to class/struct/union
left of '.IsEmpty' must have class/struct/union type
left of '->m_subject' must point to class/struct/union
left of '.IsEmpty' must have class/struct/union type
left of '->Update' must point to class/struct/union
left of '->AddNew' must point to class/struct/union
left of '->m_ID' must point to class/struct/union
left of '->m_name' must point to class/struct/union
left of '->m_subject' must point to class/struct/union
left of '->m_grade' must point to class/struct/union
 left of '->Update' must point to class/struct/union
left of '->Requery' must point to class/struct/union