Re: Ora-12154 using MS Visualc/c++

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Fri, 21 Feb 2003 18:12:35 GMT
Message-ID: <MPG.18c00bf08e42dad29896c6_at_news.la.sbcglobal.net>


pg_miguel_at_hotmail.com said...
> Hi all,
>
> I have a c program that connects to oracle 9i using proc. This program is
> developed using MSVisualc/C++ environmennt.
> The problem I encounter is as follows:
> - When I run the compiled program (.exe) it connects to the DB fine fine.
> - But when I run the program through the MSVisualc/C++ (for debugging) the
> connection error ora-12154 apears.
> In both cases I'm using exactly the same code and the same conection
> string
> defines in the tnsnames.ora.
>
(snip)

Don't know if this answers your question.

A ProC program contains non-C code which, when passed thru a preprocessor,  generates a C program with the non-C portions converted to function calls. If you try to run a ProC program in your Visual C++ IDE, the non-C code will not be understood.

If you are trying to run the C program after it has been run thru the pre-processor, then it sounds like you're experiencing a PATH problem rather than a OraNet problem (since the other utilities work). It's been a very long time since I used Visual C++, so I don't remember how you specify which environment variables to use ... but you can set the TNS_ADMIN environment variable to point to the directory where you have your tnsnames.ora.

-- 
/Karsten
DBA > retired > DBA
Received on Fri Feb 21 2003 - 19:12:35 CET

Original text of this message