TODBCConnection encloses PWD with special characters in braces making connection fail with invalid username/password
Original Reporter info from Mantis: hum802
-
Reporter name: Humberto Sa
Original Reporter info from Mantis: hum802
- Reporter name: Humberto Sa
Description:
Code in odbcconn, line 254, function CreateConnectionString encloses PWD/Password parameter in braces when special characters are in it.
This makes the connection failed with password invalid. Apparently, oracle does not recognize braces as a way to enclose special characters in passwords. As far as oracle documentation, passwords with special cases should be contained with double quotes.
The exact error message is below:
Could not connect with connection string "DRIVER=Oracle in OraClient18Home1;UID=XIZ;PWD={StrongPassword!@#};DBQ=//server:1521/sid;". ODBC error details: LastReturnCode: SQL_ERROR; Record 1: SqlState: 28000; NativeError: 1017; Message: [Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied
Steps to reproduce:
How to reproduce this error:
install oracle client
create a new project and add TODBCConnection component
Set Params properties of the TODBCConnection component as below:
DRIVER=Oracle in OraClient18Home1 this is the name of the oracle driver from OdBC data source administrator
dbq=//server:1521/sid
UID=1234567
PWD=StrongPassword!@# has to have special characters in the password. Most important character is @
Test the connection by changing "connected" to true. You should get the error message.
Additional information:
dbq is used for a TNS-less or DS-less connection. No need for tns file nor an ODBC data source.
Debugging steps:
Test the connection without braces
Test the connection with double quotes for the password parameter
Test the conneciton with single quotes for the password parameter
Mantis conversion info:
- Mantis ID: 37635
- OS: Windows
- OS Build: Windows 10
- Version: 2.0.6