vb oracle 无客户端,从VB 2008应用程序连接到Oracle DB而无需安装Oracle软件?(Connect to Oracle DB from VB 2008 application ...

从VB 2008应用程序连接到Oracle DB而无需安装Oracle软件?(Connect to Oracle DB from VB 2008 application without installing Oracle software?)

Imports System.Data.OleDb

Public Class Log

Private mConnectionString As String = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx;"

Dim ds As New DataSet

Dim da As New OleDbDataAdapter

Dim dr As DataRow

Dim Connection As New OleDbConnection(mConnectionString)

Dim Command As OleDbCommand

goes on...

这是代码,它在我们的开发机器上效果很好。 我们都在我们的机器上安装了Oracle提供程序。 现在我尝试在没有安装Oracle软件的另一台机器上的应用程序中使用此代码,但它不起作用。

现在我知道我可以在这些其他机器上安装Oracle提供程序,它将工作。 问题在于:A)他们中的很多人B)我必须通过我们的IT部门,他们需要六个月才能完成。 所以我的问题是,我可以从没有安装Oracle提供程序的机器连接到这个Oracle数据库吗? 我认为微软拥有它自己的Oracle提供商,但它没有出现在System.Data下。 如果有帮助,.NET版本是3.5。 有任何想法吗?

Imports System.Data.OleDb

Public Class Log

Private mConnectionString As String = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=xxx)(SERVER=DEDICATED)));User Id=xxx;Password=xxx;"

Dim ds As New DataSet

Dim da As New OleDbDataAdapter

Dim dr As DataRow

Dim Connection As New OleDbConnection(mConnectionString)

Dim Command As OleDbCommand

goes on...

That's the code, and it works great on our development machines. We all have the Oracle providers installed on our machines. Now I tried using this code in an app on another machine that does not have the Oracle software installed and it doesn't work.

Now I know I can install the Oracle providers on these other machines and it will work. Problem with that is A) there are many of them and B) I'd have to go through our IT department and it would take six months for them to do it. So my question is, can I connect to this Oracle database from a machine without the Oracle providers installed? I thought Microsoft had it's own Oracle provider but it doesn't show up under System.Data. The .NET version is 3.5 if that helps. Any ideas?

原文:https://stackoverflow.com/questions/364101

更新时间:2020-03-02 18:07

最满意答案

我对Oracle即时客户端和ODP.NET有相当好的运气,它几乎是一个直接的XCOPY部署(如果您不需要ODBC)。

IIRC,您确实需要修改PATH环境变量,但这相对轻松 - 特别是与Oracle过去使用的箍环相比。

I've had fairly good luck with the Oracle Instant Client and ODP.NET, which is pretty much a straight XCOPY deploy (if you don't need ODBC).

IIRC, you do need to modify the PATH environment variable, but that's relatively painless - especially compared to the hoops Oracle used to make you jump through.

2008-12-12

相关问答

您可以使用函数DBMS_SESSION.IS_ROLE_ENABLED来获取此信息。 PL / SQL部分就是这样的 CREATE OR REPLACE FUNCTION IsRoleGranted(RoleName IN VARCHAR2) RETURN Integer IS

BEGIN

IF DBMS_SESSION.IS_ROLE_ENABLED(RoleName) THEN

RETURN 1;

ELSE

RETURN 0;

END I

...

我认为oracle客户端本身并不是独立运行的。 你下载了适用于Windows的ODAC吗? 安装时尝试为不同的安装指定不同的主文件夹,例如。 32bithome或64bithome。 首先,您可以尝试32bithome(即使在64位机器上,然后尝试创建64bithome,如果它不起作用。) I think oracle client alone doesn't work standalone. Have you downloaded the ODAC for Windows?. While ins

...

有同样的问题,背景是: echo $ORACLE_HOME

/usr/lib/oracle/12.1/client64

但是:sudo env | grep ORACLE_HOME 什么也没有。 解决方案: sudo visudo

然后添加该行: Defaults env_keep += "ORACLE_HOME"

在这里找到 Got the same problem, background is: echo $ORACLE_HOME

/usr/lib/oracle/12.1/client6

...

在安装之前,请花一些时间阅读适用于您的平台和Oracle版本(32位或64位)的安装指南。 这里只是一些提示 因为这是您的第一次安装,所以尽可能简化。 您不需要数据库控制或企业管理器。 第一次没有所有的花里胡哨。 对于数据库创建,仅选择字符集和块大小 - 安装后可以更改任何其他参数和选项。 如果选择AL32UTF8,请不要执行已准备好的安装,而是选择自定义安装。 Before doing install, take some time to read installation guide for

...

您的连接字符串错误,您不能同时使用Provider=OraOLEDB.Oracle和Driver={Microsoft ODBC for Oracle} 。 如果您想使用Oracle OLE DB提供程序,请尝试以下操作: Set oConn = CreateObject("ADODB.Connection")

oConn.provider = "OraOLEDB.Oracle"

DB = host & ":" & port & "/" & SERVICE_NAME

oConn.Open "Dat

...

根据评论,你试图从外部访问apex.oracle.com数据库 - 这是不可能的。 从oracle访问在线演示工作区中访问数据库的唯一有效方法是通过SQL Workshop或APEX应用程序。 如果需要从外部访问数据,我强烈建议使用APEX的RESTfull服务。 无法通过JDBC直接连接。 According to the comments you're trying to access the apex.oracle.com Database externally - which isn't

...

步骤1 :为Visual Studio .NET安装Oracle10g第2版ODAC和Oracle Developer Tools http://www.oracle.com/technology/software/tech/dotnet/utilsoft.html 第2步 :设置Oracle_Home环境。 例如:设置Oracle_Home = C:\ oracle \ product \ 10.2.0 \ client_1 步骤3 :在\ NETWORK \ ADMIN下创建sqlnet.or

...

我对Oracle即时客户端和ODP.NET有相当好的运气,它几乎是一个直接的XCOPY部署(如果您不需要ODBC)。 IIRC,您确实需要修改PATH环境变量,但这相对轻松 - 特别是与Oracle过去使用的箍环相比。 I've had fairly good luck with the Oracle Instant Client and ODP.NET, which is pretty much a straight XCOPY deploy (if you don't need ODBC).

...

在最好的情况下,您只需将连接字符串更改为 strConnDb = "Provider=OraOLEDB.Oracle;Data Source={database TNS alias};Password=xxxx;User ID=xxx"

您可以从此处下载“Oracle Provider for OLE DB”驱动程序: 用于Windows下载的Oracle数据访问组件(ODAC) In best case you just have to change the connection string

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值