请各位高手帮帮忙,这是VC数据库连接和注册模块的连接,看看有什么问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:13:31
1数据库连接)BOOL CMy123App::InitInstance()
{
AfxEnableControlContainer();
::CoInitialize(NULL);
HRESULT hr;
try
{
hr=m_Connection.CreateInstance("ADODB Connection");
if(SUCCEEDED(hr))
{
hr=m_Connection->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=I:\student,mdb.mdb;Persist Security Info=False","","",adModeUnknown);
}
}
catch( _com_error e)
{
CString temp;
temp.Format("连接数据库错误信息:%s",e.ErrorMessage());
::MessageBox(temp);
return false;
2注册模块)void CMy123Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_mane.IsEmpty()||m_pawer.IsEmpty()||m_pawer1.IsEmpty())
{
AfxMessageBox("用户和密码不能为空");
return ;
}

if(m_pawer!=m_pawer1)
{
AfxMessageBox("密码不一致");
return;
}

拜托 这个是BOOL类型函数 要返回值的...你都是return 肯定编译错误

上面哪位,可以交个朋友请教一下吗?本人对VC真的很有浓厚兴趣,只是不是本专业,学起来有点吃苦.可以吗