I am writing a service in VB.NET to continually log data to an Oracle DB using ODP.NET
The application was originally written as a basic Windows Forms App and works however when I port it to a service it seems it cannot see the TNS file and the following error message is thrown:
Service cannot be started. Oracle.DataAccess.Client.OracleException
ORA-12154:TNS:could not resolve the connect identifier specified
So when using the following example connectstring
"Data Source= example;User Id= user;Password=password;"
I get ORA-12154
If I provide the full TNS entry directly to the app e.g
"Data Source= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = EXAMPLE)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = EXAMPLE) ) );User Id= user;Password=password;"
Then it works but when I originally developed the app as a Forms Application it worked either way.
I assumed maybe the environment variables were not set up correctly but I have added the required system variables (ORACLE_HOME / TNS_ADMIN / added the oracle folder to PATH) and it doesnt work.
The path the service is being run/was installed from does not contain parentheses, I have checked the process with process monitor and it looks like it is being started up with the correct environment variables (ORACLE_HOME / TNS_ADMIN / PATH are all there and correct). The machine being used for testing is running Win XP
What am I missing here?
Thanks