Results 1 to 3 of 3

Thread: [RESOLVED] ADODB: Connecting to Oracle DB with special character in password

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2013
    Posts
    6

    Resolved [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!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2013
    Posts
    6

    Re: ADODB: Connecting to Oracle DB with special character in password

    Quote Originally Posted by kleinma View Post
    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
  •  



Click Here to Expand Forum to Full Width