VC连库问题
bool DB_Connect(CString ConnectionStr){
HRESULT hr;
try
{
hr = m_pConnection.CreateInstance("ADODB.Connection");///创建Connection对象
if(SUCCEEDED(hr))
{
hr = m_pConnection->Open(_bstr_t(ConnectionStr),"","",adModeUnknown);///连接数据库
}
return TRUE;
}
catch(_com_error e)///捕捉异常
{
//CGlbs::m_status = "数据库连接失败!";
return FALSE;
}
}
AdoDataBase *adoDB = new AdoDataBase();//建立数据库对象
adoDB->DB_Connect(_T("Provider=OraOLEDB.Oracle.1;Password=shzh;Persist Security Info=True;User ID=shzh;Data Source=house164));
在我的机子上连上了,可生成的.exe文件在别人的机子上连不库,请教!