【问题标题】:Connecting to oracle database using Connection string Issue?使用连接字符串问题连接到 oracle 数据库?
【发布时间】:2018-04-17 04:16:56
【问题描述】:

我有一个应用程序正在使用配置文件连接到 mssql 服务器,并且在配置文件中创建并使用了 odbc。

这是我的配置文件中用于连接数据库的行。

<add key="ConnectionString" value="Data Source=<DSN Name>;Initial Catalog=<DAtabase Name>;Integrated Security=True"></add>

现在我们在 Oracle 中进行测试, 但是上面的格式没有连接,我尝试了许多其他的连接字符串排列,如下所示,但到目前为止没有运气

这和 Windows 字符串一样

<add key="ConnectionString" value="Data Source=<DSN Name>;Integrated Security=True"></add>

在 DSN 中包含我的数据库名称

  <add key="ConnectionString" value="Data Source=<DSN Name>;Initial Catalog=<DAtabase Name>;Integrated Security=True"></add>

此处包含驱动程序和 SID

<add key="ConnectionString" value= Driver=<{Oracle in OraClient11g_home1}>;Server=serverSID;Uid=<myUsername>;password=<password>
></add>

我收到的错误

数据库设置找不到配置文件中提到的数据库

没有一个在正确的 Oracle 连接字符串上工作?

【问题讨论】:

    标签: oracle odbc connection-string


    【解决方案1】:

    尝试使用DBQ= 代替Server=PWD= 代替password=

    属性Server 用于Microsoft ODBC 驱动程序(请参阅Connection String Format and Attributes)。在 Oracle 中,该属性为 DBQ(参见 Using the Oracle ODBC Driver)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多