CDatabase bd;
BOOL status;
try {status=bd.OpenEx(_T("Studentinfo"));
if(!status)
AfxMessageBox("连接数据源失败");}
catch(CMemoryException *pEx)
{pEx->ReportError();}UpdateData(true);
CStudentinfoSet pSIset;
pSIset.m_pDatabase=&bd;
pSIset.AddNew();pSIset.m_name=m_basic_name;
pSIset.m_sex=m_basic_sex;
pSIset.m_number=m_basic_number;
pSIset.m_province=m_basic_province;
pSIset.m_year=m_basic_year;
pSIset.m_month=m_basic_month;
pSIset.m_day=m_basic_day;
pSIset.m_job=m_basic_job;
pSIset.m_late=m_basic_late;
pSIset.m_notcome=m_basic_notcome;
pSIset.m_major=m_basic_major;
pSIset.m_phone=m_basic_call;
pSIset.m_address=m_basic_address;
pSIset.m_about=m_basic_about;
pSIset.Update();
pSIset.Requery();
AfxMessageBox("输入成功");
编译没有出问题,但是老是在运行的时候出现ASSERTION FAILED,谢谢!