可以debug,在运行后就这个按钮操作有问题。
void CZhucedlg::OnButtouOk()
{
UpdateData();
if(m_Name.IsEmpty()||m_Pwd.IsEmpty()||m_Pwd1.IsEmpty())
{
AfxMessageBox("用户名密码不能为空");
return;
}
if(m_Pwd!=m_Pwd1)
{
AfxMessageBox("密码不一致");
return;
}
m_pRs=theApp.m_pCon->Execute((_bstr_t)("select * form Login where Uname='"+m_Name+" '"),NULL,adCmdText);
if(m_pRs->adoEOF)
{
theApp.m_pCon->Execute((_bstr_t)("insert into Login (Uname,Upasswd,power)values('"+m_Name+"',\'"+m_Pwd+"',2)"),NULL,adCmdText);
AfxMessageBox("注册成功");
CDialog::OnOK();
}
else
{
AfxMessageBox("用户名不存在");
return;
}
// TODO: Add your control notification handler code here
}