Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    8

    Unanswered: TNS:net service name is incorrectly specified

    I'm trying to use the ODBC driver provided with th 10g Instant client and unixODBC 2.2.10 to connect to a 9.2 server on Windows. When trying to connect using SQLConnect I get the error

    TNS: Could not resolve host for given service name

    When using TWO_TASK to specify the sid I'm able to connect. Here's my call to SQLConnect

    funcResult = SQLConnect(connHandle, database, SQL_NTS, username, SQL_NTS, password, SQL_NTS);

    database, username and password are all const char *. Has anyone else had this same problem or know what I could be doing wrong?

    Thanks,
    Chris

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    > TNS:net service name is incorrectly specified

    > TNS: Could not resolve host for given service name

    Which is the actual error?

    Different errors have different solutions.

    What is the specific error code that accompanies the message?

    From what OS are you trying to initiate the connection into the Oracle database?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2005
    Posts
    8
    Sorry for the lack of information, here's the exact error message I'm recieving.

    [unixODBC][Oracle][ODBC][Ora]ORA-12162: TNS:net service name is incorrectly specified

    I'm using CentOS version 4.1 and unixODBC version 2.2.10.

    Thanks for your help.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    12162, 00000, "TNS:net service name is incorrectly specified"
    // *Cause: The connect descriptor corresponding to the net service name in
    // TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is
    // incorrectly specified.
    // *Action: If using local naming make sure there are no syntax errors in
    // the corresponding connect descriptor in the TNSNAMES.ORA file. If using
    // directory naming check the information provided through the administration
    // used for directory naming.
    [bcm@bcm wlp]$
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Nov 2005
    Posts
    8
    Yeah, so I saw that already. The fact that when I specify the SID in the TWO_TASK variable leads me to believe that my tnsnames.ora file is correct. I think it's a problem when using SQLConnect because if I change it to this for example...

    funcResult = SQLConnect(connHandle, '', SQL_NTS, username, SQL_NTS, password, SQL_NTS);

    I get the same error. The username and password are being passed correctly because when using TWO_TASk I'm able to connect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •