AfxOleInit();
m_pConnection.CreateInstance(__uuidof(Connection));
try
{
//打开本地 Sql Server库student
CString connectionStr="Driver={SQL Server};Server=(local);Database=Zhongmoyuan;UID=sa;PWD=""";
m_pConnection->Open((_bstr_t)connectionStr,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.ErrorMessage());
return FALSE;
}
为什么连接错误
具体错误信息是什么?