怎样在DAO中使用SQL语句? 不是有个函数CDaoDatabase::Execute吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 _bstr_t string; _bstr_t datasource; HRESULT hr; string="Provider=SQLOLEDB.1;Password=mmmm;Persist Security Info=True;User ID=video;Data Source="; try { hr=m_pConnection.CreateInstance(_uuidof(Connection)); datasource=AfxGetApp()->GetProfileString("jianfei","datasource",0); string+=datasource; string+=";"; if(SUCCEEDED(hr)) { // hr=m_pConnection->Open( hr=m_pConnection->Open( // _bstr_t(L"Provider=SQLOLEDB.1;Password=vzmm;Persist Security Info=True;User ID=video;Data Source=database;"), _bstr_t(string), _bstr_t(L""), _bstr_t(L""), adModeUnknown); if(SUCCEEDED(hr)) { m_IsConnectionOpen=true; } } } catch(_com_error &e) { _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); TRACE("jhljjk"); AfxMessageBox("ghfjfgjhfhgjhg!"); return false; } catch(...) { TRACE("gjghgjfh" ); return false; } return true; _RecordsetPtr pRecordset; _bstr_t bstrQuery("select * from vid_path"); _variant_t vRecsAffected(0L); pRecordset=m_pConnection->Execute(bstrQuery, &vRecsAffected, adOptionUnspecified)兄弟,如果不是新手的话,这些就足够了,可运用自如。 MFC单文档应用程序,我这个需要用到多线程吗? static LPCTSTR类型初始化的问题 SetMenuItemBitmaps最后一个参数无效 想在软件里整合发邮件功能,是自己写好,还是调用OutLook好啊 关于VC.net 编译时的问题,能解决问题还可以高分相送 !!! ncl格式的书用什么来阅读呀? 请教一个关于继承类的问题! SDI中怎样切换两个FORMVIEW? visual c++ 和c++ builder 哪一个好 VC的图形功能。 如何得到一个文件夹里的所有文件的文件名? 如何防止MFC的对话框自动关闭
_bstr_t datasource;
HRESULT hr;
string="Provider=SQLOLEDB.1;Password=mmmm;Persist Security Info=True;User ID=video;Data Source=";
try
{
hr=m_pConnection.CreateInstance(_uuidof(Connection));
datasource=AfxGetApp()->GetProfileString("jianfei","datasource",0);
string+=datasource;
string+=";";
if(SUCCEEDED(hr))
{ // hr=m_pConnection->Open(
hr=m_pConnection->Open(
// _bstr_t(L"Provider=SQLOLEDB.1;Password=vzmm;Persist Security Info=True;User ID=video;Data Source=database;"),
_bstr_t(string),
_bstr_t(L""),
_bstr_t(L""),
adModeUnknown);
if(SUCCEEDED(hr))
{
m_IsConnectionOpen=true;
}
}
} catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
TRACE("jhljjk");
AfxMessageBox("ghfjfgjhfhgjhg!");
return false;
}
catch(...)
{
TRACE("gjghgjfh" );
return false;
}
return true;
_RecordsetPtr pRecordset;
_bstr_t bstrQuery("select * from vid_path");
_variant_t vRecsAffected(0L);
pRecordset=m_pConnection->Execute(bstrQuery,
&vRecsAffected,
adOptionUnspecified)
兄弟,如果不是新手的话,这些就足够了,可运用自如。