zoukankan      html  css  js  c++  java
  • AO开发时,ISqlWorkspace执行SQL语句,无法连接其他主机上的Oracle

    代码如下,目的是创建链接Oracle数据的Sqlworkspace对象,
    Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SqlWorkspaceFactory");
    IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
    // Create the connection properties.
    IPropertySet connectionProps = new PropertySetClass();
    connectionProps.SetProperty("dbclient", "Oracle11g");
    connectionProps.SetProperty("serverinstance", "MyServer");
    connectionProps.SetProperty("authentication_mode", "DBMS");
    connectionProps.SetProperty("user", "MyLogin");
    connectionProps.SetProperty("password", "MyPassword");
    // Open the workspace.
    IWorkspace workspace = workspaceFactory.Open(connectionProps, 0);

    报错:无法链接其他主机上的Oracle数据库。

    原因:("dbclient", "Oracle11g"); 设置参数不能为大写,正确为("dbclient", "oracle11g");

  • 相关阅读:
    2014-11-1 NOIP模拟赛2
    洛谷P1014 Cantor表
    洛谷P1011 车站
    洛谷P1013 进制位
    2014-11-1 NOIP模拟赛1
    2017-9-20 NOIP模拟赛
    洛谷P2016 战略游戏
    洛谷P3182 [HAOI2016]放棋子
    2014-10-31 NOIP模拟赛
    洛谷P1736 创意吃鱼法
  • 原文地址:https://www.cnblogs.com/gis9/p/2610721.html
Copyright © 2011-2022 走看看