开发者社区> 问答> 正文

c++ ADO 连接ORACLE 数据库 windows系统验证方式连接老是失败.

OLE DB Provider for Oracle (from Oracle).
For Standard security:
Collapse | Copy Code
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;"
"User Id=myUsername;Password=myPassword;");
For a Trusted connection:
OS Authenticated connect setting user ID to "/":
Collapse | Copy Code
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;"
"User Id=/;Password=;");
OS Authenticated connect using OSAuthent:
Collapse | Copy Code
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;")
Note: "Data Source=" must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.
For more information, see: Oracle Provider for OLE DB Developer's Guide.

求大神指导啊,好几天了,就是无法用系统的验证连接数据库(Administrator用户已经加入到SYSDBA组里面了的)

展开
收起
a123456678 2016-03-04 17:59:23 3269 0
1 条回答
写回答
取消 提交回答
  • 你不用ADO,使用OLEDE 使用者模板!你添加模板的时候,就叫你选择provider,登陆的id和密码,并且可以测试数据库连接,连接成功之后,就可以选择数据库中你要操作的表,最后确定,就可以了

    2019-07-17 18:52:41
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
使用C++11开发PHP7扩展 立即下载
GPON Class C++ SFP O;T Transce 立即下载
GPON Class C++ SFP OLT Transce 立即下载

相关镜像