Connecting to Oracle 9i

V

va

I am trying to establish a connection to Oracle 9i from
asp.net.(.net 2003) The code is

Dim con As New ADODB.Connection

con.ConnectionString = "PROVIDER=MSDASQL;DRIVER=
{Microsoft ODBC for oracle};SERVER={server name};UID={user
id};PWD={password};"

con.Open()

It gives error message [Microsoft][ODBC driver for Oracle]
[Oracle]

If I use the same code in VB 6.0 it works. I am using
Windows 2000 operating system. If I try from Windows XP
it works from asp.net after changing security for
ociw32.dll. I tried to do the same on Windows 2000.
Still it does not work. Any other way of making it work?
 
M

Miha Markic

Hi,

You should use System.Data.Oracle namespace and the classes within
(OracleConnection etc.) - managed providers.
 
M

Miha Markic

It is OracleClient and not Oracle namespace...

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Miha Markic said:
Hi,

You should use System.Data.Oracle namespace and the classes within
(OracleConnection etc.) - managed providers.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

va said:
I am trying to establish a connection to Oracle 9i from
asp.net.(.net 2003) The code is

Dim con As New ADODB.Connection

con.ConnectionString = "PROVIDER=MSDASQL;DRIVER=
{Microsoft ODBC for oracle};SERVER={server name};UID={user
id};PWD={password};"

con.Open()

It gives error message [Microsoft][ODBC driver for Oracle]
[Oracle]

If I use the same code in VB 6.0 it works. I am using
Windows 2000 operating system. If I try from Windows XP
it works from asp.net after changing security for
ociw32.dll. I tried to do the same on Windows 2000.
Still it does not work. Any other way of making it work?
 
P

Paul Clement

¤ I am trying to establish a connection to Oracle 9i from
¤ asp.net.(.net 2003) The code is
¤
¤ Dim con As New ADODB.Connection
¤
¤ con.ConnectionString = "PROVIDER=MSDASQL;DRIVER=
¤ {Microsoft ODBC for oracle};SERVER={server name};UID={user
¤ id};PWD={password};"
¤
¤ con.Open()
¤
¤ It gives error message [Microsoft][ODBC driver for Oracle]
¤ [Oracle]
¤
¤ If I use the same code in VB 6.0 it works. I am using
¤ Windows 2000 operating system. If I try from Windows XP
¤ it works from asp.net after changing security for
¤ ociw32.dll. I tried to do the same on Windows 2000.
¤ Still it does not work. Any other way of making it work?

Is there a reason why you are using ADO instead of ADO.NET?

You should be using Oracle specific drivers:

http://www.able-consulting.com/MDAC...iders.htm#OLEDBProviderForOracleFromMicrosoft
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForOracle


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top