c++ ADO 连接ORACLE 数据库 windows系统验证方式连接老是失败.-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

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

a123456678 2016-03-04 17:59:23 1394
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.


Oracle 安全 关系型数据库 数据库 C++ Windows
取消 提交回答
  • a123456678
    2019-07-17 18:52:41

    你不用ADO,使用OLEDE 使用者模板!你添加模板的时候,就叫你选择provider,登陆的id和密码,并且可以测试数据库连接,连接成功之后,就可以选择数据库中你要操作的表,最后确定,就可以了

    0 0
+ 订阅