Unanswered: Trying to connect to external Oracle DB Server
When trying to connect to an external Oracle DB (by using the Connectionbuild in Delphi - with Provider 'Oracle Provider for OLE DB'), for Data Source, I put the IP address of the Oracle Server.
The error I get is
Test connection failed because of an error in initializing provider. ORA-12560: TNS: protocol adapter error
Does anybody have an idea where the problem is situated? Is the problem at my side, or at the side of the person to whom the Oracle Server belongs?
Your error is coming from your tnsnames set up. From what you have listed, it seems that your client (local) does not know how to translate your connection request. If you are simply trying to supply a hostname or IP address as the way for your client (application) is to find the database, you will have to make sure your sqlnet.ora file is set up properly. For example, you should have a line in this file that looks like this:
NAMES.DIRECTORY_PATH = (TNSNAMES,HOSTNAME)
Having directory_path set to "hostname" tells the Oracle client that applications may also enter the hostname to locate a database.
My preferred way to connect to a database is to include an alias in the tnsnames.ora file for the target database. To me, this has two benefits: one, if there are multiple databases on the destination machine, you can specify which SID to connect to very easily; two, if the destination machine changes, you change only the tnsnames.ora file, not your code that references the hostname/ip address.