471,337 Members | 1,057 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 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 8187
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by yahibble | last post: by
2 posts views Thread by tim.pascoe | last post: by
2 posts views Thread by python_eager | last post: by
3 posts views Thread by jens Jensen | last post: by
2 posts views Thread by rcc.gamer | last post: by
reply views Thread by rosydwin | last post: by

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.