vb.net 如何解决错误 ORA-06413:连接未打开?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23003631/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 17:29:19  来源:igfitidea点击:

How do I resolve the error ORA-06413: Connection not open?

vb.netoracle

提问by Mohd Syafiq Sulaiman

My local environment VS2012

我的本地环境VS2012

Using Oracle 10g XE

使用 Oracle 10g XE

Dim dbConn As New OleDbConnection

Dim dbComm As OleDbCommand

dbConn.ConnectionString = "Provider=msdaora;Data Source=XE;User ID=scott;Password=tiger"

dbConn.Open()

Tip error: ORA-06413: Connection not open.

提示错误:ORA-06413:连接未打开。

Already check the TNSNAMES.ora, SQLNET.ora, LISTENER.ora and its nothing wrong.

已经检查了 TNSNAMES.ora、SQLNET.ora、LISTENER.ora 并没有错。

But why this error appear? :(

但是为什么会出现这个错误呢?:(

回答by Pablo Fébolo

The error is caused by the parenthesis in the pathname.

该错误是由路径名中的括号引起的。

possibly you execute VS2012 from C:\program file (x86)...

可能你从 C:\program file (x86) 执行 VS2012 ...

workaround: create a junction link

解决方法:创建一个联结链接

steps:

脚步:

  1. from: command line execute

    C:>mkLink /j "Program Files x86" "Program Files (x86)"
    

    and then

  2. fix the (or create a new) shortcut with new path (C:\program file x86...)

  1. 来自:命令行执行

    C:>mkLink /j "Program Files x86" "Program Files (x86)"
    

    进而

  2. 使用新路径 (C:\program file x86 ...) 修复(或创建新的)快捷方式

回答by Mostafa Ait Baallal

I worked a lot on this problem, I lost a lot of time. apparently IIS Express in Visual Studio uses the oracle provider 64 bit.

我在这个问题上做了很多工作,我浪费了很多时间。显然,Visual Studio 中的 IIS Express 使用 64 位的 oracle 提供程序。

To solve this trick:

要解决这个技巧:

1) I installed IIS on my PC (Windows 10) with .NET 4.5 or higher

1) 我在我的 PC (Windows 10) 上安装了 IIS 和 .NET 4.5 或更高版本

2) I compiled the Web API application with 32 bit target.

2) 我用 32 位目标编译了 Web API 应用程序。

3) I publish the web application on my IIS.

3) 我在我的 IIS 上发布了 Web 应用程序。

4) On IIS I set enable the apps 32 bit to true

4) 在 IIS 上,我将启用应用程序 32 位设置为 true

回答by Willian Rafacho

I had the same problem and I resolved the problem installing Oracle 11g Express. Before, I removed all previous Oracle client installation. I use windows 7 64 bit.

我遇到了同样的问题,我解决了安装 Oracle 11g Express 的问题。之前,我删除了所有以前的 Oracle 客户端安装。我使用 Windows 7 64 位。

回答by Jacek

Create Bat file to start excel in bat put path you can adjust to match your folders

创建 Bat 文件以在 bat put 路径中启动 excel 您可以调整以匹配您的文件夹

start c:\progra~2\micros~1\Office14\Excel.exe

启动 c:\progra~2\micros~1\Office14\Excel.exe

When you start excel just open macro and try :)

当您启动 excel 时,只需打开宏并尝试:)

回答by Waqar Hameed

1.just uninstall your toad or oracle 2. reinstall on on your window drive ex:(c/d/e) in new folder

1. 只需卸载您的 toad 或 oracle 2. 在您的窗口驱动器上重新安装例如:(c/d/e) 在新文件夹中

don't install in program files(x86) its work for me

不要安装在程序文件(x86)中,它对我有用

because program files(x86) is for 32 bit application...

因为程序文件(x86)适用于 32 位应用程序...

回答by kickAssDeveloper

I encountered the same problem when working on my Visual studio 2013 project. I was able to run the same project from SVN on a different machine, but it just WON'T work on mine. I checked the connection string and could successfully test the connection in Oracle, but it would throw a disgusting “ORA-06413: Connection not open” error from code.

我在处理 Visual Studio 2013 项目时遇到了同样的问题。我能够在另一台机器上从 SVN 运行相同的项目,但它在我的机器上不起作用。我检查了连接字符串,可以在 Oracle 中成功测试连接,但它会从代码中抛出令人厌恶的“ORA-06413:连接未打开”错误。

I got it fixed this way - Install Oracle 11g client -> Select "Administrator" as Type of Installation. Re-open Visual Studio and it worked. Hope it helps!

我通过这种方式修复了它 - 安装 Oracle 11g 客户端 -> 选择“管理员”作为安装类型。重新打开 Visual Studio 就可以了。希望能帮助到你!

回答by Shahzaib Zaheer

I have resolved by error after the days of searching:

经过几天的搜索,我错误地解决了:

Error Cause:

错误原因:

This error due to oracle reserved character "(",")" and in Windows 64 bit there is an folder "Program Files (x86)" is creation problem.

由于 oracle 保留字符“(”,”)”而导致的此错误,并且在 Windows 64 位中有一个文件夹“Program Files (x86)”是创建问题。

Solution:

解决方案:

Create a link folder for "Program Files (x86)" using below command on Window Drive path.

1).Open cmd with administrator.

mklink /j "Program Files x86" "Program Files (x86)" ENTER

在 Window Drive 路径上使用以下命令为“Program Files (x86)”创建一个链接文件夹。

1).用管理员打开cmd。

mklink /j "程序文件 x86" "程序文件 (x86)" ENTER

or visit link

或访问链接

download3k article

下载3k文章

2).open registry(with administrator)->Export Registry always backup a registry file before changing it.make a copy of registry file and work on copy. Open Registry file(Copy) in text editor replace "(x86)" to "x86" Save file and import it in registry and restart you computer.

2).open registry(with administrator)->Export Registry 在更改之前总是备份注册表文件。制作注册表文件的副本并进行复制。在文本编辑器中打开注册表文件(复制)将“(x86)”替换为“x86”保存文件并将其导入注册表并重新启动计算机。

Now "ORA-06413: Connection not open" error go away.

现在“ORA-06413:连接未打开”错误消失了。

Please rate this solution if your issue resolve. Enjoy!

如果您的问题得到解决,请评价此解决方案。享受!