Oracle 9i: ORA-01017: invalid username/password; logon denied — oracle-tech

    Forum Stats

  • 3,716,000 Users
  • 2,242,928 Discussions
  • 7,845,734 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Oracle 9i: ORA-01017: invalid username/password; logon denied

3713965
3713965 Member Posts: 2
edited June 2018 in ODP.NET

I get the following exception when I try to connect to my Oracle 9i database from my Visual Studio 2017 application:

ORA-01017: invalid username/password; logon denied

Code:

<span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #101094;">var</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> connectionString </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> </span><span class="str" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #7d2727;">"Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myServerName)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=mySID)));User Id = myUsername; Password = myPassword"</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #101094;">var</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> con </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #101094;">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">OracleConnection</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">connectionString</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;"> con</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">.</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">Open</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #303336;">();</span>

Same problem when I try the same code with only the "System.Data.OracleClient" assembly and when I try to add a new Data Connection via Server Explorer in Visual Studio.

I tried setting System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled to 0 with no luck.

When I use SQL Developer I am able to connect to the same database with same credentials and perform any query. Any idea ?

Database: Oracle 9i

Visual Studio : 2017

Best Answer

  • 3713965
    3713965 Member Posts: 2
    edited June 2018 Accepted Answer

    Thanks Alex, indeed that was part of the problem.

    Here are all the steps :.

    - remove any associated plugin in Visual Studio

    - execute uninstall.bat from your ODAC downloaded folder

    - remove any associated tool in Windows Add or Remove Program

    - Remove remaining Oracle folders (in C:\, C:\ProgramFiles, ...)

    Make sure there is no remaining Oracle reference in GAC, otherwise delete them.

    The latest compatible version of Oracle provider is Oracle version + 2 (9+2=11), meaning the maximum version I had to install was 11.2.0.4. After installing this version and compile my code in x64 (Any CPU or x32 won't load the DLL) evrything was working.

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited May 2018

    ODP.NET 12c and Oracle Client 12c versions are not supported when connecting to Oracle 9i DB servers and earlier server versions. You need to use ODP.NET 11.2 client version to connect to a 9.2 DB.

    3713965
  • 3713965
    3713965 Member Posts: 2
    edited June 2018 Accepted Answer

    Thanks Alex, indeed that was part of the problem.

    Here are all the steps :.

    - remove any associated plugin in Visual Studio

    - execute uninstall.bat from your ODAC downloaded folder

    - remove any associated tool in Windows Add or Remove Program

    - Remove remaining Oracle folders (in C:\, C:\ProgramFiles, ...)

    Make sure there is no remaining Oracle reference in GAC, otherwise delete them.

    The latest compatible version of Oracle provider is Oracle version + 2 (9+2=11), meaning the maximum version I had to install was 11.2.0.4. After installing this version and compile my code in x64 (Any CPU or x32 won't load the DLL) evrything was working.

This discussion has been closed.