Skip to Main Content

Oracle Database Discussions

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!

Connection string problem

user9534250Dec 9 2013 — edited Dec 10 2013

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.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2014
Added on Dec 9 2013
9 comments
6,686 views