Link to home
Start Free TrialLog in
Avatar of ljpitre
ljpitre

asked on

ORA-12154: TNS:could not resolve service name

I have a VB6 project.  When I run it from with in the VB6 development enviornmnet the database connections works.  However, when I compile the project, the same code gives the following set of errors when the EXE is ran.

Error No: 00001 An error occurred while connecting to the 'FMIMSDEVLSC' database.

ORA-12154: TNS:could not resolve service name
Avatar of SaxonWica
SaxonWica

Did you run the exe from another computer?
Check your TNSnames.ora configuration file
Avatar of ljpitre

ASKER

I found the cause. The folder name of the project was "FMIMS_VB(EXE)"  The runtime (EXE) did not like the (EXE) in the folder name.  When I removed the () from the folder name, the runtime version worked ok.  I do not understand why the parenthesis as part of the folder name where the EXE was stored caused a TNS error.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello.

Just a comment. I had a problem with ORA 12154 Unable to resolve TNSNames.... and I think the underlying cause was similar to this.....

Story: I was running an applet (developed in VB) to query against an Oracle db.... using Oracle 8 client.... everything fine...... then installed Oracle 9i client.... changed out ODBC (Test connection ok) ...... but the VB applet would no longer connect...got the ORA 12154...

So... used other (non VB) apps to test connections.... all okay.... just the VB applet would not connect....  

Now, to clarify, I must admit that the fact of it being "VB" or "Not VB" did not occur to me while I was investigating.... until I read this posting and the thing about EXE being in the folder name..... when I looked at my install folder it did not have EXE in the folder name, but what it did have was parenthesis () in the folder name...... did a quick experiment.... tried running applet and connecting to db first with the exe in a folder with parenthesis, then in a folder without parenthesis.... sure enough, the brackets in the folder name were the problem...

So.. problem solved for me but I do not know why.... ie is it an Oracle 9 thing? is it a VB thing? or combo of both?