I am connecting to Oracle 11g from MFC application using CDatabase class. I need DSN less connection.
I downloaded 64-bit ODAC 12c Release 1 (12.1.0.1.0) for Windows x64 from oracle.com. These contain 64-bit Oracle ODBC Driver 12.1.0.1.0.
Using this driver, I am able to connect to Oracle using TNS service. This works fine. Following is the connection string,
"Driver=Oracle in OraClient12Home1;Dbq=ORCL2;Uid=system;Pwd=manager"
But if I try connect using hostname, port, database name, it gives error. Following is the connection string I am using,
"Driver={Oracle in OraClient12Home1};Uid=system;Pwd=pass1;Server=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xyz)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)(SERVER=DEDICATED)));"
I want to connect without using TNS service. Is it possible? Is there something wrong?
Thanks.