Precompilers and OCI (MOSC)

MOSC Banner

Problem with OCI recognizing changed TNS_ADMIN environment variable

edited Apr 27, 2010 9:47PM in Precompilers and OCI (MOSC) 3 commentsAnswered
Hi, I've encountered an odd problem with OCI and I hope someone can help me with it.
I have a Windows 2003 Enterprise Server on which Oracle XE is installed.  In addition, the Oracle 11.0 client is also installed, so the PATH environment variable looks like this:

Path=F:\app\Administrator\product\11.1.0\client_1\bin;F:\oraclexe\app\oracle\product\10.2.0\server\bin;...

I've written a C++ program that uses the Win32 SetEnvironmentVariable() function to set the TNS_ADMIN variable to the \network\admin directory in either the 11.0 client or XE directory.  Then, it attempts to log in to an Oracle database using a TNS name and account name unique to my 11.0 and XE server.  If the program logs in to only one or the other, the log in succeeds.  However, if the program logs in to one, logs out, and then attempts to log in to the other, then the second log in fails with "ORA-12154: TNS:could not resolve the connect identifier

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center