472,952 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

Trouble connecting to Oracle database from C#

Hi,
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:

dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;

This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:

ORA-06401: NETCMN: Invalid driver designator

I have tried to reproduce the error on a VMWARE Windows 2000 sp4
machine (that does not have a Oracle server or client installed) but
there it works after installing MDAC version 2.8. I am not able to
reproduce the error...

Do you have any idea what is wrong?

I include the the following DLL files with the code:
oraociei10.dll, oci.dll, oraocci10.dll, ociw32.dll, orannzsbb10.dll

Best regards,
Kim Therkelsen

Jul 3 '07 #1
5 8334
ki***********@gmail.com wrote:
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:

dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;

This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:

ORA-06401: NETCMN: Invalid driver designator

I have tried to reproduce the error on a VMWARE Windows 2000 sp4
machine (that does not have a Oracle server or client installed) but
there it works after installing MDAC version 2.8. I am not able to
reproduce the error...

Do you have any idea what is wrong?

I include the the following DLL files with the code:
oraociei10.dll, oci.dll, oraocci10.dll, ociw32.dll, orannzsbb10.dll
A googling finds a lot of references to this problem.

Many of them indicate a mismatch between connection string
and tnsnames.ora.

So you should check that.

An interesting twist is:
http://www.phpbuilder.com/board/arch...hp/t-6705.html

Arne

PS: Why not use an Oracle ADO.NET provider instead of OLE DB ?
Jul 4 '07 #2
Hi!

As I wrote, I do not intend to install a Oracle client on the PCs if I
can avoid it. So there is no tnsnames.ora file on the machine. The
application uses the included dlls. If I use the exact same settings
on my test w2k machine without Oracle client or server installed, it
works. I think it perhaps would work if I also installed a Oracle
client on all the machines and then used the tnsname in the connection
string but that is a lot of work and a lot of software for such a
simple task.

Actually I did not write the code myself but if it makes things easier
to use Oracle ADO.NET instead of OLE DB, I will change it.

/Kim
On 4 Jul., 03:15, Arne Vajhøj <a...@vajhoej.dkwrote:
kimtherkel...@gmail.com wrote:
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:
dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;
This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:
ORA-06401: NETCMN: Invalid driver designator
I have tried to reproduce the error on a VMWARE Windows 2000 sp4
machine (that does not have a Oracle server or client installed) but
there it works after installing MDAC version 2.8. I am not able to
reproduce the error...
Do you have any idea what is wrong?
I include the the following DLL files with the code:
oraociei10.dll, oci.dll, oraocci10.dll, ociw32.dll, orannzsbb10.dll

A googling finds a lot of references to this problem.

Many of them indicate a mismatch between connection string
and tnsnames.ora.

So you should check that.

An interesting twist is:
http://www.phpbuilder.com/board/arch...hp/t-6705.html

Arne

PS: Why not use an Oracle ADO.NET provider instead of OLE DB ?

Jul 4 '07 #3
<ki***********@gmail.comschrieb im Newsbeitrag
news:11**********************@n60g2000hse.googlegr oups.com...
Hi,
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:

dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;

This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:

ORA-06401: NETCMN: Invalid driver designator
This is a error message from Oracle. Since OLEDB is not C# specific. I
suppose you should ask this in an Oracle group.

Christof
Jul 4 '07 #4

We solved the problem!

A ORACLE_HOME environment path had to be set to point at the folder
containing the dlls. Otherwise this specific PC would look for the
libraries in other places because it previously had a Oracle 9i client
installed.

Best regards,
Kim Therkelsen

On 4 Jul., 10:56, "Christof Nordiek" <c...@nospam.dewrote:
<kimtherkel...@gmail.comschrieb im Newsbeitragnews:11**********************@n60g2000h se.googlegroups.com...
Hi,
I use the System.Data.OleDb.OleDbConnection class to establish a
connection to a Oracle 10G database.
The dsn connection string I use look like this:
dsn=provider="MSDAORA.1";User ID=test;Data Source="172.30.0.25/
JBOS";Password=test;
This works fine in Windows XP and Windows server 2003 but I have a
customer that try to connect to the database from a Windows 2000
machine and gets the following error:
ORA-06401: NETCMN: Invalid driver designator

This is a error message from Oracle. Since OLEDB is not C# specific. I
suppose you should ask this in an Oracle group.

Christof

Jul 4 '07 #5
ki***********@gmail.com wrote:
As I wrote, I do not intend to install a Oracle client on the PCs if I
can avoid it. So there is no tnsnames.ora file on the machine. The
application uses the included dlls. If I use the exact same settings
on my test w2k machine without Oracle client or server installed, it
works. I think it perhaps would work if I also installed a Oracle
client on all the machines and then used the tnsname in the connection
string but that is a lot of work and a lot of software for such a
simple task.

Actually I did not write the code myself but if it makes things easier
to use Oracle ADO.NET instead of OLE DB, I will change it.
I believe that all Oracle only supports solutions with
Oracle client installed on PC's (except for Java JDBC thin
driver, which is probably not so relevant for you).

Arne
Jul 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yahibble | last post by:
Now, I am no Python expert but I have dabbled and I have spent a couple of days with another engineer unsuccessfully installing oracle drivers for MS ODBC on the win XP machine. It looked to me...
2
by: tim.pascoe | last post by:
I'm currently trying to establish a linked server to an Oracle database. Setup: Connecting to 8x version of Oracle Using 9i client tools (Net Manager) SQL-Server 2000 Windows 2000 I...
2
by: python_eager | last post by:
Hi i am connecting my database oracle 9i. While connecting i am getting the following error connection = cx_Oracle.connect("myusername", "mypassword", "python") RuntimeError: Unable to acquire...
3
by: jens Jensen | last post by:
exception: "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater." fails at connection.Open();
0
by: antonyliu2002 | last post by:
I am having a hard time connecting to an oracle database from within Visual Web Developer (VWD) 2005 Express Edition. Check out the screen snap shot here: ...
2
by: rcc.gamer | last post by:
Hello All, I am trying to connect a GridView to an Oracle table using the standard SqlDataSource. The process is fairly simple and there are detailed instructions from Microsoft ......
0
by: piyushdabomb | last post by:
Hi Oracle Gurus!! Before I proceed, as per the moderators request, I would like to mention that I have already taken a look at the other threads pertaining to a similar issue which I am having and...
7
by: cyberbilly1 | last post by:
Hi All! I'm trying to connect to a remote oracle database using the OracleConnection within VB.net . Whenever I try connecting I get a SocketException:No connection could be made because the...
1
by: kinnu | last post by:
hi, could any one help me with the steps of connecting the vb form with the oracle database/table. I could connect vb to access. as my collage project requires connecting of vb with oracle...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.