void CLogon::OnOK() 
{
// TODO: Add extra validation here
UpdateData();
//如果用户名和密码不为空则执行以下操作

//成生sql语句
m_pwd=theApp.addpwd(m_pwd,true);
CString sql="SELECT * FROM alluser where name='"+m_user+"' and pwd='"+m_pwd+"'";
try
{
//查询数据库,看是否有此用户和密码
m_pRecordset.CreateInstance("ADODB.Recordset");
m_pRecordset->Open((_variant_t)sql,_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);

if(m_pRecordset->adoEOF)
{
               AfxMessageBox("password is wrong!!!!!!!!");
}
else
{
theApp.name=m_user;
theApp.pwd=m_pwd;
CDialog::OnOK();
return;
}
}
catch(_com_error e)///捕捉异常
{
CString temp;
temp.Format("连接数据库错误信息:%s",e.ErrorMessage());
AfxMessageBox(temp);
return;
}


}
m_pwd=theApp.addpwd(m_pwd,true);//看不懂