MFC中操作ACCESS添加新数据是提示参数不足是什么意思,怎么解决
时间:2011-12-24
来源:互联网
这个是添加数据的代码
void CBeta1View::OnAdd()
{
CAdd_Modify dlg;
//m_pSet->MoveLast();
m_pSet->AddNew();
if(dlg.DoModal() == IDOK)
{
m_pSet->m_Name = dlg.m_name;
m_pSet->m_Gender = dlg.m_gender;
m_pSet->m_Birthday = dlg.m_birthday;
m_pSet->m_Certificate = dlg.m_certificate;
m_pSet->m_CertificateNo = dlg.m_certificateNo;
m_pSet->m_Degree = dlg.m_degree;
m_pSet->m_GraduateDate = dlg.m_graduateDate;
m_pSet->m_GraduatePer = dlg.m_graduatePer;
m_pSet->m_Nation = dlg.m_nation;
m_pSet->m_National = dlg.m_national;
m_pSet->m_ResearchDir = dlg.m_reserchDir;
m_pSet->m_Title = dlg.m_title;
m_pSet->m_GraduateSchool = dlg.m_graduateSchool;
m_pSet->Update();
//m_pSet->Requery();
m_pSet->MoveLast();
UpdateData(false);
}
}
这个是DEBUG是出现问题的代码 终止于红色那一行,p_Set在前面还有信息,一直到绿色那行就变为
TRY
{
#ifndef _AFX_NO_OCC_SUPPORT
// special case for WM_DESTROY
if ((nMsg == WM_DESTROY) && (pWnd->m_pCtrlCont != NULL))
pWnd->m_pCtrlCont->OnUIActivate(NULL);
#endif
// special case for WM_INITDIALOG
CRect rectOld;
DWORD dwStyle = 0;
if (nMsg == WM_INITDIALOG)
_AfxPreInitDialog(pWnd,&rectOld,&dwStyle);
// delegate to object's WindowProc
lResult = pWnd->WindowProc(nMsg,wParam,lParam);
// more special case for WM_INITDIALOG
if (nMsg == WM_INITDIALOG)
_AfxPostInitDialog(pWnd,rectOld,dwStyle);
}
CATCH_ALL(e)
{
CWinThread* pWinThread = AfxGetThread();
if ( pWinThread != NULL )
{
lResult = pWinThread->ProcessWndProcException(e,&pThreadState->m_lastSentMsg);
TRACE1("Warning: Uncaught exception in WindowProc (returning %ld).\n",
lResult);
}
else
{
TRACE0("Warning: Uncaught exception in WindowProc.\n");
lResult = 0;
}
DELETE_EXCEPTION(e);
}
END_CATCH_ALL
pThreadState->m_lastSentMsg = oldState;
return lResult;
}
小弟刚接触MFC,求各位大大指教。
void CBeta1View::OnAdd()
{
CAdd_Modify dlg;
//m_pSet->MoveLast();
m_pSet->AddNew();
if(dlg.DoModal() == IDOK)
{
m_pSet->m_Name = dlg.m_name;
m_pSet->m_Gender = dlg.m_gender;
m_pSet->m_Birthday = dlg.m_birthday;
m_pSet->m_Certificate = dlg.m_certificate;
m_pSet->m_CertificateNo = dlg.m_certificateNo;
m_pSet->m_Degree = dlg.m_degree;
m_pSet->m_GraduateDate = dlg.m_graduateDate;
m_pSet->m_GraduatePer = dlg.m_graduatePer;
m_pSet->m_Nation = dlg.m_nation;
m_pSet->m_National = dlg.m_national;
m_pSet->m_ResearchDir = dlg.m_reserchDir;
m_pSet->m_Title = dlg.m_title;
m_pSet->m_GraduateSchool = dlg.m_graduateSchool;
m_pSet->Update();
//m_pSet->Requery();
m_pSet->MoveLast();
UpdateData(false);
}
}
这个是DEBUG是出现问题的代码 终止于红色那一行,p_Set在前面还有信息,一直到绿色那行就变为
TRY
{
#ifndef _AFX_NO_OCC_SUPPORT
// special case for WM_DESTROY
if ((nMsg == WM_DESTROY) && (pWnd->m_pCtrlCont != NULL))
pWnd->m_pCtrlCont->OnUIActivate(NULL);
#endif
// special case for WM_INITDIALOG
CRect rectOld;
DWORD dwStyle = 0;
if (nMsg == WM_INITDIALOG)
_AfxPreInitDialog(pWnd,&rectOld,&dwStyle);
// delegate to object's WindowProc
lResult = pWnd->WindowProc(nMsg,wParam,lParam);
// more special case for WM_INITDIALOG
if (nMsg == WM_INITDIALOG)
_AfxPostInitDialog(pWnd,rectOld,dwStyle);
}
CATCH_ALL(e)
{
CWinThread* pWinThread = AfxGetThread();
if ( pWinThread != NULL )
{
lResult = pWinThread->ProcessWndProcException(e,&pThreadState->m_lastSentMsg);
TRACE1("Warning: Uncaught exception in WindowProc (returning %ld).\n",
lResult);
}
else
{
TRACE0("Warning: Uncaught exception in WindowProc.\n");
lResult = 0;
}
DELETE_EXCEPTION(e);
}
END_CATCH_ALL
pThreadState->m_lastSentMsg = oldState;
return lResult;
}
小弟刚接触MFC,求各位大大指教。
作者: IceKnc 发布时间: 2011-12-24
不是MFC的问题,
字段有不比配的值,或缺少字段没有添加。
字段有不比配的值,或缺少字段没有添加。
作者: chinatcp 发布时间: 2011-12-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28