Connecting to Oracle 9i

  • Thread starter Thread starter va
  • Start date Start date
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?
 
Hi,

You should use System.Data.Oracle namespace and the classes within
(OracleConnection etc.) - managed providers.
 
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?
 
¤ 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)
 
Back
Top