ora-12560
ora-12560
I have an application that can uses either sql server or oracle. In switching to unidac I have no problems on my machine with both databases, but, when I send my application to my tester, they get an ora-12560 TNS:protocol adapter error.
We are both using local Oracle 11.2 databases.
I'm sure it's something simple, what am I missing?
Thanks!
Jeff
We are both using local Oracle 11.2 databases.
I'm sure it's something simple, what am I missing?
Thanks!
Jeff
Re: ora-12560
BTW, not sure if it was clear, but the tester can connect with SQL Server, but not Oracle.
Re: ora-12560
Also, we are using Delphi 7, and 4.1.6 for unidac
Re: ora-12560
Sorry to keep dripping info, I just want to be as complete as possible.
In addition, the second, tester's machine, does work with oracle via toad, sqlplus, as well as our oracle version of our software, written with DOA components.
In addition, the second, tester's machine, does work with oracle via toad, sqlplus, as well as our oracle version of our software, written with DOA components.
Re: ora-12560
hello,
This error can occur for many reasons.
Please, make sure that if several Oracle clients are installed on this machine, you are using the correct one; by default the default client is used. The Oracle client can be changed in UniConnection.SpecificOptions
You should also check that the client data are present in the register in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE branch, and that they are correct. Check that the path to the Oracle client is specified in the environment variables. Check the tnsnames.ora file, it must contain a record for the database you are trying to connect to.
This error can occur for many reasons.
Please, make sure that if several Oracle clients are installed on this machine, you are using the correct one; by default the default client is used. The Oracle client can be changed in UniConnection.SpecificOptions
Code: Select all
UniConnection1.SpecificOptions.Values['HomeName'] := 'HomeName';Re: ora-12560
Alex, thank you, but I am still confused, my machine, the one that this works on, doesn't have a HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE branch, and it works fine for unidac, a doa application, toad, and sql plus.
Re: ora-12560
Not sure if this helps, but trying to use oracle via direct connect, my machine works fine, but the other machine gives an ORA-12505 error.
Re: ora-12560
hello,
If the connection string for the direct mode is hard-coded in your application, the settings (SID and PORT) must be the same on the rest of machines,
this also applies to the OCI mode (tnsnames.ora files must contain the same Service_Name with which your application works)
If the connection string for the direct mode is hard-coded in your application, the settings (SID and PORT) must be the same on the rest of machines,
this also applies to the OCI mode (tnsnames.ora files must contain the same Service_Name with which your application works)
Re: ora-12560
The connection string is entered at log in, with the app remembering.
I am at a total loss
I am at a total loss
Re: ora-12560
hello,
Please compile the console application code shown below, and run it from the command line with the following parameters:
Project1.exe login/password@IP_ADDRESS:PORT:SID TRUE for the Direct mode, and
Project1.exe login/password@SID for the OCI mode, and let us know the results.
P.S. If you try to connect in the Direct mode using ServiceName instead of SID, you should specify the follwing in the connection string:
login/password@IP_ADDRESS:PORT:SN=ServiceName
Please compile the console application code shown below, and run it from the command line with the following parameters:
Project1.exe login/password@IP_ADDRESS:PORT:SID TRUE for the Direct mode, and
Project1.exe login/password@SID for the OCI mode, and let us know the results.
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils,
Ora,
OraError;
var
OraSession: TOraSession;
begin
OraSession := TOraSession.Create(nil);
try
OraSession.ConnectString := ParamStr(1);
if ParamStr(2) = '' then
OraSession.Options.Direct := False
else
OraSession.Options.Direct := StrToBool(ParamStr(2));
try
OraSession.Connect;
Writeln('Connected!');
except
on E: EOraError do
Write(Format('ORA-%d, ErrorMessage: %s', [E.ErrorCode, E.Message]));
end;
finally
Readln;
OraSession.Free;
end;
end.login/password@IP_ADDRESS:PORT:SN=ServiceName
Re: ora-12560
Alex,
Sorry I missed this reply, and had moved on to another project. Well, I'm back on our Oracle project and have the same problem.
I tried to compile your console app but don't have ora, or oraerror dcu files.
btw, I am using Universal Data Access Components 4.6.11 for Delphi 7.
Thanks!!!
Jeff
Sorry I missed this reply, and had moved on to another project. Well, I'm back on our Oracle project and have the same problem.
I tried to compile your console app but don't have ora, or oraerror dcu files.
btw, I am using Universal Data Access Components 4.6.11 for Delphi 7.
Thanks!!!
Jeff
Re: ora-12560
Hello,
You can use the following code for UniDAC:
You can use the following code for UniDAC:
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils,
Uni,
OraclassesUni,
OracleUniProvider,
OraErrorUni;
var
UniConnection: TUniConnection;
Username, Password, Server: String;
ConnectMode: TConnectMode;
begin
ParseConnectString(ParamStr(1), Username, Password, Server, ConnectMode);
UniConnection := TUniConnection.Create(nil);
try
UniConnection.Server := Server;
UniConnection.Username := Username;
UniConnection.Password := Password;
if ParamStr(2) <> '' then
UniConnection.SpecificOptions.Values['Direct'] := ParamStr(2);
try
UniConnection.Connect;
Writeln('Connected!');
except
on E: EOraError do
Write(Format('ORA-%d, ErrorMessage: %s', [E.ErrorCode, E.Message]));
end;
finally
Readln;
UniConnection.Free;
end;
end.Re: ora-12560
Alex,
I wasn't passing in the server info properly. Thank you so much!
Jeff
I wasn't passing in the server info properly. Thank you so much!
Jeff
Re: ora-12560
Hello,
Glad to see that you solved the problem. If you have any other questions, feel free to contact us
Glad to see that you solved the problem. If you have any other questions, feel free to contact us