MySQL Forums
Forum List  »  Oracle

using SQLDriverConnect with special characters in password fails, same info with ODBC (Oracle instant client) works fine
Posted by: roy jojo
Date: July 28, 2013 02:12AM

Hi,
on a windows 2008 machine that has the Oracle instant client 11_1 installed (11.01.00.06) i am calling SQLDriverConnect in the following way:

std::string str = "Driver={Oracle in instantclient11_1};Dbq=//10.10.101.66:1521/orcl;;Uid=myUser;pwd=a;b";
odbcRc = SQLDriverConnect(hdbc, NULL, (SQLTCHAR*)str.c_str(), str.size(), (SQLTCHAR*)szConnStrOut, 1024, &cbConnStrOut, SQL_DRIVER_NOPROMPT)) == SQL_ERROR);

as long as the password contains no special chars (namely semicolon) it works fine. but when I try to use special chars in the password It stops working, with an invalid username/password error.
State: 28000 Native error: 1017 Message: [Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied

i tried different variations of adding " (\") over the password, over the entire pwd=a;b or braces { but nothing seems to work.
the thing is that using ODBC works! what I did was:

open ODBC, go to System DSN tab, add "Oracle in instantclient11_1", then fill the following information:

Data source name: Anything
TNS Service Name: //10.10.101.66:1521/orcl
User ID: myUser

then i press test connection, enter the password "a;b"
and it works!

I cannot figure out what's my problem.

Thanks,
Roy.

Options: ReplyQuote


Subject
Views
Written By
Posted
using SQLDriverConnect with special characters in password fails, same info with ODBC (Oracle instant client) works fine
4738
July 28, 2013 02:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.