Search code examples
c#oracle-databaseoracle9ioracle.manageddataaccess

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


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:

var connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myServerName)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=mySID)));User Id = myUsername; Password = myPassword";
var con = new OracleConnection(connectionString);
con.Open();

Same problem when :

  • using same code with System.Data.OracleClient assembly

  • trying 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


Solution

  • I found the answer.

    • 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.