创建Command对象失败,是什么原因?
周江涛 2005-10-24 10:05:18 先初始化Com,创建Recordset可以,接下来再创建Command就不行了?
m_pRstPub.CreateInstance(__uuidof(Recordset));
if (m_pRstPub == NULL)
{
AfxMessageBox("Create Recordset failed");
return false;
}
CString str;
m_pCmd.CreateInstance(__uuidof(Command));
if (m_pCmd == NULL)
{
str.Format("Create Command failed %d", GetLastError());
AfxMessageBox(str);
return false;
}