vc++如何在单击登陆按钮后跳转到下一个界面
懒懒程序员 2012-07-02 02:39:21 void CMy1Dlg::OnOk()
{
// TODO: Add your control notification handler code here
CDatabase m_database;
//BOOL bLogin=FALSE;
CLogin *m_recordset=new CLogin(&m_database);
CString strSQL;
//int type=0;
UpdateData(TRUE);
strSQL.Format("select * from user_pass where username='%s' and password='%s'",m_username,m_password);
m_recordset->Open(AFX_DB_USE_DEFAULT_TYPE,strSQL);
if(m_recordset->GetRecordCount()==0)
{
AfxMessageBox("用户名或密码错误!");
}
else
{
AfxMessageBox("登陆成功!");
}
}
//这是按钮代码,接下来怎么添加