错误连接到Oracle数据库从.NET应用程序在Windows 7 [英] Error connecting to oracle database from a .net application on Windows 7

查看:308
本文介绍了错误连接到Oracle数据库从.NET应用程序在Windows 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误时,我的.Net WinForms应用程序试图连接到Oracle数据库使用System.Data.OracleClient.dll作为提供64位Windows 7 machine.Am。

I get this error when my .Net winforms application tries to connect to Oracle database on a 64-bit Windows 7 machine.Am using System.Data.OracleClient.dll as a provider.

OCIEnvCreate失败,返回code -1,但错误消息文本不可   可用。

OCIEnvCreate failed with return code -1 but error message text was not available.

我能够连接到使用UDL文件,用这台机器上的SQL Plus中效用相同的数据库。

Am able to connect to the same database using a "udl file" and using "SQL Plus" utility on this machine.

在我的Windows 7机器,ORACLE_HOME目录正确指向32位客户端环境变量和注册表太大,但还是我得到了同样的错误。

On my windows 7 machine, ORACLE_HOME directory is correctly pointing to 32 bit client in the environment variable and registry too, but still am getting the same error.

此外,我能够连接到从.net应用程序这个数据库中的Windows XP计算机上,即使没有任何的这些环境变量present。

Also, am able to connect to this database from .Net app on a Windows XP machine even if does not have any of these environment variables present.

能否请您指教?

感谢您的阅读。

推荐答案

从你的问题,它可能是有用的知道你的设置,即VS2010 / 2008等?
这是一个最近的问题还是一台新机器的构建?

From your question, it may be useful to know your setup i.e. VS2010 /2008 etc.?
Is this a recent problem or a new machine build?

你有一个单一的Oracle客户端安装即哪个版本,或者是你想使用即时客户端? (你有pviously安装可能导致混乱的旧版本$ P $)

Do you have a single oracle client installation i.e. which version, or are you trying to use instant client? (did you have an old version previously installed that may be causing the confusion)

该System.Data.OracleClient的现在是很preciated和ODP.NET(Oracle.DataAccess)为建议的替换直接从Oracle。

The System.Data.OracleClient is now depreciated and ODP.NET (Oracle.DataAccess) is a suggested replacement direct from oracle.

我有一个Windows 7的开发机采用VS2010 + ODP.NET 11.2(ODAC)与11.1的32位客户端和64位客户端(不知道我需要这个)。

I have a windows 7 development machine with VS2010 + ODP.NET 11.2 (ODAC) with a 11.1 32bit client and a 64bit client (not sure if I needed this one).

请问您的解决方案生成或者你收到此错误信息使用GUI或在运行时? 您可以使用在VS服务器资源管理器连接? 你有没有使用甲骨文的作品,并可以在你的机器上进行测试?.NET应用程序

Does your solution build or do you get this error message when using the gui or at runtime? Are you able to use the server explorer within VS to connect? Do you have a .net application that uses oracle that works and can be tested on your machine?

您也可以设置在环境中的TNS_ADMIN路径

You could also set the TNS_ADMIN path in the environment.

检查是否有路径集,包括如C:\ ORACLE \产品\ 11.1.0 \ Client 32客户\ bin中,尝试将其添加到PATH环境年初

Check that you have the path set including e.g. C:\Oracle\product\11.1.0\client32\bin, try to add it to the beginning of the path environment.

是否在其他帐户下你的应用程序运行?

Does your application run under another account?

以上可能像安东尼客户端配置问题建议。

More than likely a client configuration issue like Antonio suggests.

这篇关于错误连接到Oracle数据库从.NET应用程序在Windows 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆