- 3,716,000 Users
- 2,242,928 Discussions
- 7,845,734 Comments
Forum Stats
Discussions
Categories
- 17 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 1.6K Databases
- 476 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 5 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 417 SQLcl
- 42 SQL Developer Data Modeler
- 184.9K SQL & PL/SQL
- 21K SQL Developer
- 1.9K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 9 DevOps
- 3K QA/Testing
- 256 Java
- 6 Java Learning Subscription
- 10 Database Connectivity
- 67 Java Community Process
- 1 Java 25
- 9 Java APIs
- 141.1K Java Development Tools
- 6 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 125 LiveLabs
- 30 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 3 Deutsche Oracle Community
- 11 Español
- 1.9K Japanese
- 2 Portuguese
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:
<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
-
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
-
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.
-
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.