Page 1 of 2
Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Error
Posted: 26.09.2013, 23:17
by toyman
After updateing my XE2 to Update 4 I no longer can connect with Oracle databases of my client. Anytime I try to connect, I have got error message:
None of the dynamic libraries can be found or is not loadable: oci.dll !
Use TZConnection.LibraryLocation if the location is invalid
Of course - I have put valid path+file name into LibraryPath, copied oci.dll into win32/debur directory, modified PATH environment variable - nothing helps, putted oci.dll into system/system32 in windows directory. Tryed to reinstal operating system - ZEOS works perfectly until Update 4 od XE2 has been installed.
Everything works perfectly at this computer on Delphi 7 + ZEOS 6.6.5-stable
Exactly the same problem occured on another two machines after updateing Delphi XE2 do Update 4, ale both have the same non-problemo on Delphi 7. Seems there is no matter which operating system I use - same problem on Vista, Win7
Problem with ZEOS 7.0.3-stable occures ONLY with Oracle database. Nothing wrong happends when using PostgreSQL, MySQL, MS SQL or SQLite databases
Has anyone any idea what should I check to correnct this strange behavior ?
Re: Delphi XE2, ZEOD 7.0.3-stable and Oracle Connection Erro
Posted: 27.09.2013, 19:13
by EgonHugeist
Imho, don't you need to copy the oci.dll since Oracle expects some more libs.
Just use TZConnection.LibraryLocation := 'Your OCI path\oci.dll'.
May i ask for your compile target? Did you have the expected (32 or 64Bit) client installed? I think you're using the W64 target now..
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 28.09.2013, 07:32
by toyman
I have used wrong description.
Instead of
toyman wrote: Of course - I have put valid path+file name into LibraryPath
I should say
toyman wrote: Of course - I have put valid path+file name into LibraryLocation property in the ZConnection component
My target platform is Win32, and oracle client is also 32bit.
I have tested this on Vista 32bit machine, on Win7 64bit, and fresh insallation of Win7 64bit - everytime everything works perfectly until applying Update 4 for Delphi XE2 (need that update because of one of the key component, that requires it) - after that oracle connection via ZEOS stops working.
EDIT:
I have to apologize - after putting proper oci.dll location in LibraryLocation property - error message have changed to: "OCI_ERROR: "
I have done some basic debugging (which I dropped since Delphi 7 did not have such problems), but I have stopped at TZOracleConnection.Open method, which calls GetPlainDriver.EnvNlsCreate method that returns Status=-1. Then CheckOracleError displays error dialog.
EnvNlsCreate method calls low level API function: OracleAPI.OCIEnvNlsCreate but there I have stopped. I have found Oracle API documentation for this function:
http://docs.oracle.com/cd/B10501_01/app ... i15re6.htm ,but my English is't good enough to understand what is wrong with that.
Re: Delphi XE2, ZEOD 7.0.3-stable and Oracle Connection Erro
Posted: 28.09.2013, 18:02
by EgonHugeist
Did check 7.0.3.
Loading multiple dll's lice oci or postgres isn't supported with 7.0.3.
Since 7.0.4 we support that.
ZPlainLoader.pas, change this function:
Code: Select all
function TZNativeLibraryLoader.ZLoadLibrary(Location: String): Boolean;
var newpath, temp: String; // AB modif
begin
if FLoaded then
Self.FreeNativeLibrary;
temp := ''; //init for FPC
FLoaded := False;
Result := False;
newpath := ExtractFilePath(Location);
// AB modif BEGIN
try
if newpath <> '' then begin
temp := GetCurrentDir;
SetCurrentDir(newpath);
end;
// AB modif END
{$IFDEF UNIX}
{$IFDEF FPC}
FHandle := LoadLibrary(PAnsiChar(Location));
{$ELSE}
FHandle := HMODULE(dlopen(PAnsiChar(Location), RTLD_GLOBAL));
{$ENDIF}
{$ELSE}
FHandle := LoadLibrary(PChar(Location));
{$ENDIF}
// AB modif BEGIN
finally
if temp<>'' then
SetCurrentDir(temp);
end;
// AB modif END
if (FHandle <> INVALID_HANDLE_VALUE) and (FHandle <> 0) then
begin
FLoaded := True;
FCurrentLocation := Location;
Result := True;
end;
end;
and it should work than.
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 28.09.2013, 19:29
by toyman
Thank You for Your time - did't expect any reaction
I have commented old version of ZLoadLibrary function, and inserted Your version. After rebuilding - Error message did not disappeard and did not changed - it still says: "SQL Error: OCI_ERROR: "
After debugging ZLoadLibrary variables got following values:
FLoaded = TRUE
temp = <path_to_debug_folder_of_my_test_project>
Result = TRUE
newpath = D:\oracle\product\10.2.0\client_2\bin\
Location = D:\oracle\product\10.2.0\client_2\bin\oci.dll
Fhandle = 268435456
FCurrentLocation = D:\oracle\product\10.2.0\client_2\bin\oci.dll
so - it seems library is loaded, but GetPlainDriver.EnvNlsCreate(FHandle, OCI_OBJECT, nil, nil, nil, nil, 0, nil, OCI_CLIENT_CHARSET_ID, OCI_CLIENT_CHARSET_ID); function called inside TZOracleConnection.Open (ZDbcOracle.pas) function still returns value = -1
FHandle before and after executing this function has value = nil
OCI_OBIECT of course is constant with value =2
OCI_CLIENT_CHARSET_ID have value = 0
OCI_CLIENT_CHARSET_ID also have value = 0
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 01.10.2013, 14:58
by EgonHugeist
Grumble,
may i ask if you use TCurrencyFields somewhere? If so we had a nice longstanding stack-killer in our sources. Fixed since 7.0.4.
Btw. 7.0.6 is released. You can download it on SourceForge.net.
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 02.10.2013, 07:24
by toyman
No. I'm not using TCurrencyFields.
Today I have moved to 7.1.1-rc (TZConnection.Version property says: 7.0.3-beta - I was unable to find 7.0.6 on sourceforge) and ... nothing changed. Still got OCI_ERROR
As I say - ZEOS 6.6.5-stable works on the same environment (on Delphi 7. The same machine where Delphi XE2 Update 4 is installed - on every machine with that setup) perfectly without any unexpected behaviors and errors. Byt I cannot use Delphi 7 with new project.
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 08.10.2013, 22:50
by EgonHugeist
Uh i'm sorry. 7.0.6 was staged for some days and is available now.
But i don't expect any changes in this domain. I have NO problems with oracle.
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 09.10.2013, 10:19
by toyman
I have't any problems with ZEOS and Oracle BEFORE installation Update 4 for Delphi XE2.
Question: Do You have update 4 installed in Your XE2 environment ?
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 09.10.2013, 21:30
by EgonHugeist
Nope, I don't have a XE2 compiler or later. My XE is deprecated inbetween...
Mostly i use such by making a TeamViewer-Session. So i can help as long i can not verify the issues by my selves.
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 10.10.2013, 08:48
by toyman
In my case TeamViever session is not an option - I work with Oracle database via VPN, which is configurad to disable any other communication - including LAN. I cannot disable this option - this is configured by other side.
But - You say if I let You look at my environment via TV - You can spend some of You time to try solve this problem (assuming I can organize some local Oracle environment) ?
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 10.10.2013, 20:31
by EgonHugeist
I think so. Just prepare a local environment and i'll try my best...
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 18.10.2013, 12:21
by marsupilami
Hello Michael,
I do have a Computer with Delphi XE2 installed. So if you want to, I could manage to grant access to it for solving this problem.
Best regards,
Jan
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 19.10.2013, 14:09
by miab3
@toyman
Latest version of Delphi XE2 was Update 4 Hotfix 1.
http://edn.embarcadero.com/article/42282
That you use?
I had no problems with it and Oracle Database Express Edition 11g Release 2.
Michal
Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro
Posted: 19.10.2013, 15:14
by toyman
I have only: Delphi XE2 and C++Builder XE2 Update 4 - in the Installed Updates section of About window.
Thanks for information. I'll try install hotfix 1 and we will see if it solve problem.