Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-12154: TNS:could not resolve the connect identifier specified

630991Mar 28 2008 — edited Apr 1 2008
ORA-12154: TNS:could not resolve the connect identifier specified

Driver's SQLSetConnectAttr failed;

Hi All,
I am developing a small application using visual c++. In which I making a ODBC connection to a oracle database
I get the above quoted error.

My connection string inside the application looks as follows

CDatabase m_cDataBase;

BOOL bConnectionStatus = m_cDataBase.OpenEx(_T("DSN=") + m_sGroupConfigServer.cStrDSN T(";UID=")+ msGroupConfigServer.cStrUserName T(";PWD=")+ msGroupConfigServer.cStrPassword cStrConnectionString,CDatabase::noOdbcDialog);

After it got resolved inside program the connection string will look like as follows

BOOL bConnectionStatus = m_cDataBase.OpenEx(_T("DSN=pfax_atx;UID=PF;PWD=pftest”),CDatabase::noOdbcDialog);

My tnsnames.ora file entry looks like quoted below

PFAX_ATX.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = titanium)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pfax_atx)
)
)

My sqlnet.ora files looks as quoted

AUTOMATIC_IPC = OFF
TRACE_LEVEL_CLIENT = OFF
names.directory_path = (TNSNAMES)
names.default_domain = world
name.default_zone = world

I created the DSN with name pfax_atx, and test connection was successful.
But still get the following error when i connect it from the application

1007;ORA-12154: TNS:could not resolve the connect identifier specified

Driver's SQLSetConnectAttr failed;
Can some kindly render some suggestion?

Thanks and Regards
Radhakrishnan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2008
Added on Mar 28 2008
1 comment
2,607 views