|
-
Oct 22nd, 2013, 01:23 PM
#1
Thread Starter
New Member
[RESOLVED] ADODB: Connecting to Oracle DB with special character in password
Hi,
I'm trying to connect to an Oracle database.
The user enters his/her username and password.
The connection works great, as long as the user does not have special characters in his/her password. If the password contains certain special characters (not only quotation marks), the connection fails. Most of the times I get an error message, saying that my TNS connection string is wrong.
Here's my code:
Code:
oCn.Open("Driver={Microsoft ODBC for Oracle};" & _
"Server=" & server & ";" & _
"Uid=" & txtUser.Text & ";" & _
"Pwd=" & txtOldPW.Text)
What do I have to do so that a user could connect, for example, with a password of N@7pz+6? or even L"1p'7'1Av?
Thanks!
-
Oct 22nd, 2013, 03:14 PM
#2
Re: ADODB: Connecting to Oracle DB with special character in password
I don't use Oracle unless I have to because of a client requirement, but I don't see the issue with N@7pz+6 as a password. Did that actually fail? L"1p'7'1Av would fail because of the quotes in it, but to escape those you would just double them up. L""1p''7''1Av
I don't think there are any other ways to escape characters here, so sometimes it may just be a matter of not using certain characters for a password, like a semicolon, which is used as the property delimiter in connection strings.
Another option if you have no success here, would be to try to use the managed oracle data provider for .NET, instead of using generic ODBC.
http://www.oracle.com/technetwork/to...ex-085163.html
-
Oct 24th, 2013, 06:08 AM
#3
Thread Starter
New Member
Re: ADODB: Connecting to Oracle DB with special character in password
 Originally Posted by kleinma
I don't use Oracle unless I have to because of a client requirement, but I don't see the issue with N@7pz+6 as a password. Did that actually fail? L"1p'7'1Av would fail because of the quotes in it, but to escape those you would just double them up. L""1p''7''1Av
I don't think there are any other ways to escape characters here, so sometimes it may just be a matter of not using certain characters for a password, like a semicolon, which is used as the property delimiter in connection strings.
Another option if you have no success here, would be to try to use the managed oracle data provider for .NET, instead of using generic ODBC.
http://www.oracle.com/technetwork/to...ex-085163.html
Thank you for your reply. Yes, N@7pz+6 actually failed saying that the TNS identifier is not correct.
Using the oracle data provider for .NET actually worked - even N@7pz+6 does not cause an issue anymore. Thank you very much!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|