Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-12154 Error using ODBC on Win2k

Re: ORA-12154 Error using ODBC on Win2k

From: Randy Harris <randy_at_SpamFree.com>
Date: Fri, 16 Apr 2004 00:17:30 GMT
Message-ID: <uCFfc.2$mh1.1@newssvr16.news.prodigy.com>

"Warren Wright" <warren.wright_at_us.scorex.com> wrote in message news:8497c269.0404151514.7ad483a0_at_posting.google.com...
> Please help point me in the right direction.
>
> I am trying to SQLDriverConnect to our Oracle Server, which resides on
> another machine in the network.
>
> I believe I have the ODBC connection set up correctly, as clicking
> "Test Connection" and then entering a valid username/password connects
> successfully.
>
> Here is the tnsnames.ora file from my client machine:
>
> CSDWORLD.ENA.US.EXPERIAN.LOCAL =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = w4533071)(PORT = 1521))
> )
> (CONNECT_DATA =
> (SERVICE_NAME = csdworld)
> )
> )

It's very likely that your client is not adding the domain name to your net service alias. Create another entry in your client tnsnames.ora, exactly like the one above, but with only "CSDWORLD =" on the first line. Like this:

 CSDWORLD =
   (DESCRIPTION =

     (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = w4533071)(PORT = 1521))
     )
     (CONNECT_DATA =
       (SERVICE_NAME = csdworld)
     )

   )

HTH,
Randy

> As you can see, the remote host is w4533071, which I can ping, etc
> from my box, and I can connect to that remote database using the
> various Oracle tools like SQL Plus or Enterprise Manager Console.
>
> Here is the relevant ODBC trace section:
> ---------------------------------------------------
> SRV40 98c-588 ENTER SQLDriverConnectW
> HDBC 019D2188
> HWND 00000000
> WCHAR * 0x01997310 [ -3] "******\ 0"
> SWORD -3
> WCHAR * 0x01997310
> SWORD 8
> SWORD * 0x00000000
> UWORD 0 <SQL_DRIVER_NOPROMPT>
>
> SRV40 98c-588 EXIT SQLDriverConnectW with return code -1
> (SQL_ERROR)
> HDBC 019D2188
> HWND 00000000
> WCHAR * 0x01997310 [ -3] "******\ 0"
> SWORD -3
> WCHAR * 0x01997310
> SWORD 8
> SWORD * 0x00000000
> UWORD 0 <SQL_DRIVER_NOPROMPT>
>
> DIAG [08004] [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve
> service name
> (12154)
>
> DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's
> SQLSetConnectAttr failed (0)
> ---------------------------------------------------
>
> If it matters, my test application is written in Visual C++ 6.0,
> latest service pack.
>
> Oracle version 9.2 (I believe).
>
> Please get me started, and I look forward to trying your suggestions.
>
> Regards,
>
> Warren Wright
> Dallas, TX
Received on Thu Apr 15 2004 - 19:17:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US