T. Paul Szczesniak
Member
I'm trying to connect a TOracleSession to a database without having to make an entry to the tnsnames.ora file.
I've found some posts that imply that this can be done by creating a connection string in the syntax of a tnsnames.ora entry.
I've tried the following combinations but I always get an ORA-12154 Error:
LogonDatabase := 'CONN77=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID)))';
LogonDatabase := '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID)))';
LogonDatabase := 'DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID))';
I was able to connect using the EZCONNECT syntax (LogonDatabase := 'MYIP:1521/MYSID'
but this required that the EZCONNECT option be added to the sqlnet.ora NAMES.DIRECTORY_PATH property. The default installation of the Oracle Client does not include the EZCONNECT setting and I would prefer to not have to make this change on every client machine.
Is my syntax not correct for the tnsnames string?
Is there a way to connect without any changes to the tnsnames.ora and sqlnet.ora files?
I've found some posts that imply that this can be done by creating a connection string in the syntax of a tnsnames.ora entry.
I've tried the following combinations but I always get an ORA-12154 Error:
LogonDatabase := 'CONN77=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID)))';
LogonDatabase := '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID)))';
LogonDatabase := 'DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MYIP)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYSID))';
I was able to connect using the EZCONNECT syntax (LogonDatabase := 'MYIP:1521/MYSID'

Is my syntax not correct for the tnsnames string?
Is there a way to connect without any changes to the tnsnames.ora and sqlnet.ora files?