Oracle ODBC Connection failed

1.8k views Asked by At

While trying to connect to a database server via ODBC from a windows console program the connection is successful and getting data. But when i try to use same code in a windows service and at

odbc_connection.open();

I am getting this error

odbcERROR [08004] [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

Any idea what configuration is missing on my machine. Some idea might be helpful

1

There are 1 answers

0
T.S. On

Your service runs as some user. Usually, when you create service, it sets some default account there. When you run the code manually, it is executed under your privileges. When service runs the code, privileges are from the account under which service runs. Just go to this service and try to run as yourself

enter image description here