22,300
社区成员




BOOL CMyServerApp::Login(CString name, CString pass)
{
CString st1 = _T("SELECT mima FROM dbo.卖家账户信息 WHERE SNo=")+name;
CString st2=NULL;
TRY
{
rs.Open(AFX_DB_USE_DEFAULT_TYPE,st1); //打开查询记录
rs.GetFieldValue(_T("mima"),st2); //得到数据
}
CATCH(CDBException,ex)
{
AfxMessageBox(ex->m_strError);
AfxMessageBox(ex->m_strStateNativeOrigin);
}
AND_CATCH(CMemoryException,pEx)
{
pEx->ReportError();
AfxMessageBox(_T("memory exception"));
}
END_CATCH
if(st2==pass)
{
return true;
}
else
{
return false;
}
}