下面代码在程序打包到没装vs2010的电脑上运行出现指针错误
CString strSQL1,strSRC1,strRB;strSQL1.Format(_T("select * from Log order by ID"));
strSRC1=theApp.GetConnStr();
_RecordsetPtr m_pRecordset1;
m_pRecordset1.CreateInstance(__uuidof(Recordset));
try
{
m_pRecordset1->Open((_variant_t)strSQL1,(_variant_t)strSRC1,adOpenDynamic ,adLockOptimistic,adCmdText);
}
catch(_com_error e)///捕捉异常
{
CString tempkh;
tempkh.Format(_T("读取客户错误, 数据库未能打开:%s"),e.ErrorMessage());
AfxMessageBox(tempkh);
}
在自己电脑上没错,可以!但是打包到没装vs2010的电脑上运程程序时就出现:读取客户错误, 数据库未能打开:指针错误,请问是什么原因。