Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
-
HJHahne
- Posts: 4
- Joined: Tue 13 Apr 2010 10:04
Post
by HJHahne » Tue 13 Apr 2010 10:17
Hello
I am using Delphi 2007 and ODAC 6.90. I want to connect to a Oracle 10g via Oracle instant client (OCI.DLL).
When I try to connect in design mode I get the error message "ORA-12154: TNS:could not resolve the connect identifier specified."
But when I start my program with the same Server / Username / Password settings, everything is fine.
Is there any solution for this behavior ?
Kind regards
H-J Hahne
-
bork
- Devart Team
- Posts: 649
- Joined: Fri 12 Mar 2010 07:55
Post
by bork » Wed 14 Apr 2010 08:37
Hello,
Make sure that you don't change Username, Password, Server, HomeName, Options.Direct in the runtime. Or maybe you create a new OraSession in the runtime and forget to fill one of these properties.
If two or more Oracle clients are installed on your computer then try to specify the HomeName property for your OraSession in the designtime and in the runtime.
-
HJHahne
- Posts: 4
- Joined: Tue 13 Apr 2010 10:04
Post
by HJHahne » Wed 14 Apr 2010 08:45
Hi
I'm using only one installation from the Instanst Client. PATH is set to this client. In my program I'm using exactly the same TOraSession in design time like in run time. At runtime the property Connected is set to true. All other property remain the same like in design time.
Regards
H-J Hahne
-
bork
- Devart Team
- Posts: 649
- Joined: Fri 12 Mar 2010 07:55
Post
by bork » Wed 14 Apr 2010 14:35
Unfortunately we cannot reproduce your issue. But we want to find the cause of such TOraSession behavior.
We offer that you create a new empty application. Add to the form TOraSession and TButton. Set the Username, Password, and Server properties in designtime. Write the OnClick event for TButton:
procedure TForm1.Button1Click(Sender: TObject);
begin
OraSession1.Open;
end;
Now try to open you OraSession in the designtime and in the runtime by pressing the button on the form.
Please tell us if you can open OraSession in the designtime and in the runtime.
Also tell us which operation system are you using. Under Windows Vista and Windows 7 user and Delphi can have different permissions and it can cause such strange behavior.
-
HJHahne
- Posts: 4
- Joined: Tue 13 Apr 2010 10:04
Post
by HJHahne » Thu 15 Apr 2010 18:37
I'm using Win 7 64 Bit
Ok, I found the problem. In my project directory is a tnsnames.org file. So at runtime this one is used to connect.
But where is the tnsnames.org searched in design time ?
I tried to setup the HomeName to the path with the tnsnames.ora file. Make no difference.
What I have to do ?
Regards
H-J Hahne
-
bork
- Devart Team
- Posts: 649
- Joined: Fri 12 Mar 2010 07:55
Post
by bork » Fri 16 Apr 2010 11:26
It seems like OCI searches the tnsnames.org file at first in the current folder and then the folder defined in the "PATH" environment variable. In the the designtime the current folder is the one where BDS.exe is located. In the runtime the current folder is the one where your application is located. In the first case OCI cannot find the tnsnames.org file in the current folder and looks for it in the folders that are defined in the "PATH" environment variable.
But in any case I don't recommend you to use several different tnsnames.org files except the tnsnames.org file that is located in the Oracle installation folder.
-
HJHahne
- Posts: 4
- Joined: Tue 13 Apr 2010 10:04
Post
by HJHahne » Fri 16 Apr 2010 12:27
Hi
Thanks, you helped me a lot, now it works. As a workaround, I copied the tnsnames.ora in the BDS directory.
I will check later my path settings.
Kind regards
H-J Hahne