VC通过ADO链接ORACLE数据库的一个简单的小例子:
Code
搜索积分与排名
最新评论
|
VC通过ADO链接ORACLE数据库的一个简单的小例子: Code
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "rsEOF") CoInitialize(NULL); _ConnectionPtr pConn(_uuidof(Connection)); _RecordsetPtr pRst(_uuidof(Recordset)); pConn->ConnectionString = _T("Provider=OraOLEDB.Oracle; Data Source=utfgs; User Id=utfgs; Password=utfgs"); pConn->Open("","","",adConnectUnspecified); pRst = pConn->Execute("select * from equipment",NULL,adCmdText); while(!pRst->rsEOF) { CString item=pRst->GetCollect("equipmentid"); ((CListBox*)GetDlgItem(IDC_LIST2))->AddString((_bstr_t)pRst->GetCollect("equipmentid")); pRst->MoveNext(); } pRst->Close(); pConn->Close(); pRst.Release(); pConn.Release(); CoUninitialize();
|
Copyright @
2025 过河的小兵
Powered by .NET 9.0 on Kubernetes
Powered by:
.Text and
ASP.NET
Theme by: .NET Monster
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步