注册 登录
编程论坛 VC++/MFC

帮忙解决一下

donggegege 发布于 2012-03-06 21:21, 358 次点击
只有本站会员才能查看附件,请 登录
编好的注册程序,一运行就这样,什么原因啊???
5 回复
#2
donggegege2012-03-06 21:44
补充一下是当按下“提交”按钮的时候出现的情况。(本该链接到数据库处理的,却出现上面的情况)
#3
BianChengNan2012-03-07 08:46
可以debug吗???
#4
zhoufeng19882012-03-07 09:18
发提交按钮消息响应上来撒~
#5
donggegege2012-03-07 12:16
可以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
   
}
#6
zhoufeng19882012-03-08 17:18
m_pRs=theApp.m_pCon->Execute((_bstr_t)("select * form Login where Uname='"+m_Name+" '"),NULL,adCmdText);
这一句吧?调试一下
1