包括获得连接字符串的过程 求能人指点 或者推荐个学习资料
解决方案 »
- 关于 RECT ,GDI作图函数的问题
- 为什么编译器会提示这种错误???(VC++ 2005)
- 我用VC写的none MFC的DLL,编译没问题,就是不能调用,请大家看看是什么问题
- WSAEventSelect与accept触发的问题??
- 求救:想把装载的位图资源,随鼠标在视图内移动;为何显示的图片老是不正常?
- 关于数据包!必给分!
- 谁能写一小段 IDiskQuotaControl 的实例 ?
- 对话框中点击标题栏,最小化,还原最小化分别是什么消息啊?
- 请问有什么办法让Winamp一边播放音乐,我能同时获得声卡的输出波形数据??????
- nurbs曲面的数值计算
- 新手提问:关于如何向listbox control控件插入数据
- 如何实现选取图像的部分区域
http://hi.baidu.com/nkym0626/blog/item/c25c6b1e1f769af31ad57677.html
http://topic.csdn.net/u/20100907/23/ecf4483a-9809-4499-85e4-b360b088f4a1.html
_ConnectionPtr adoConn;
_RecordsetPtr adoRs;
CString sql; _bstr_t m_ConnectionString=_T("Provider=SQLOLEDB;Server=(local);Database=数据库名; uid=sa;Password=;");
sql.Format(_T("select * from VIEW_Compensate where ID=%d "),id);
try
{
hr = adoConn.CreateInstance(__uuidof(Connection));
hr = adoRs.CreateInstance(__uuidof(Recordset)); hr = adoConn->Open((BSTR)m_ConnectionString, L"", L"", adCmdUnspecified);
hr=m_rec->Open((LPCTSTR)sql, (IDispatch*)adoConn, adOpenUnspecified,
adLockUnspecified, adCmdUnspecified);
catch(_com_error& e)
{
}