Print Thread
Page 1 of 2 1 2
Unable to connect from DLL
#58299 09/08/18 02:32 PM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
Hello, Environment is Windows 10-64 bit, Delphi Tokyo Patch 3, DOA 4.1.1.0 (at least according to readme.txt file). Scenario. I am using a COM library (AddIn-Express) to build a plug-in for Excel (i.e. a DLL). Everything is working fine and running. I am now wanting to add Oracle connectivity. I have a menu option, which opens a new form. I add an OracleSession component ONLY to this form. This form has a button which does the Oracle processing. For now, there is basically only the following code...

with OracleSession1 do
try
LogonUsername := 'FY19';
LogonPassword := 'FY19';
LogonDatabase := 'orcl';
LogOn;
ShowMessage('Logged on successfully.');
except
on E: EOracleError do
ShowMessage(E.Message);
end;

When I step through the code, the LogOn line is causing an AV with the following... EXCEL.EXE has caused an exception at address... When I click the button, I get the real message... Access Violation in module OraClient12.Dll.

Excel is 64 bit, and my compile option is set to 64 bit. My plugin is working fine with the exception of the newly added OracleSession component. My Delphi Library path is pointing to the 64bit DOA directory. Oracle RDBMS (12.2.0.1.0 64 bit) is located on the same computer. SQLPlus runs fine with the connection string... FY19/FY19@orcl

Any idea what is causing the issue?

Last edited by G Spears; 09/08/18 02:53 PM.
Re: Unable to connect from DLL
G Spears #58300 09/08/18 02:45 PM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
FYI - I did just upgrade to the latest release of DOA - 4.1.3.5 - and have the same problem.

Last edited by G Spears; 09/08/18 02:53 PM.
Re: Unable to connect from DLL
G Spears #58302 09/10/18 09:26 AM
Joined: Aug 1999
Posts: 22,201
Member
Offline
Member
Joined: Aug 1999
Posts: 22,201
Do the host application and DLL both access Oracle?


Marco Kalter
Allround Automations
Re: Unable to connect from DLL
Marco Kalter #58304 09/10/18 11:16 AM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
The host application is Excel. It does NOT access Oracle. Only the Excel plug-In I am writing does. The Plug-In is in the form of a DLL.

Re: Unable to connect from DLL
G Spears #58305 09/10/18 11:25 AM
Joined: Aug 1999
Posts: 22,201
Member
Offline
Member
Joined: Aug 1999
Posts: 22,201
That's odd. What happens if you create a little test project that makes the same connection as a .exe instead of a .dll?


Marco Kalter
Allround Automations
Re: Unable to connect from DLL
Marco Kalter #58306 09/10/18 11:34 AM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
Just made a small, 64-bit app with just the OracleSession component. I added a button which executed the LogOn code shown in the first post. It connected fine. I tested both from within the Delphi IDE, and running the exe standalone when Delphi is NOT running. Both connected fine.

I also checked that when I load my DLL project into Delphi, I can go to the OracleSession component and check the 'Connected' property, and it connects fine there. (Although I do normally develop with this NOT checked.)

As a final test, I completed exited Delphi. I ran Excel with my DLL. When I try to connect to Oracle, I get the AV.

Last edited by G Spears; 09/10/18 11:41 AM.
Re: Unable to connect from DLL
G Spears #58307 09/10/18 11:50 AM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
Marco, I just sent you (via email) a full stack dump. Hopefully that will shed some light on the root cause.

Re: Unable to connect from DLL
G Spears #58311 09/11/18 03:40 PM
Joined: Jun 2011
Posts: 12
G
Member
OP Offline
Member
G
Joined: Jun 2011
Posts: 12
Any update on this?

Re: Unable to connect from DLL
G Spears #58315 09/12/18 08:28 AM
Joined: Aug 1999
Posts: 22,201
Member
Offline
Member
Joined: Aug 1999
Posts: 22,201
I sent you the following question by e-mail reply yesterday:

Could it be that the TOracleSession instance is nil when connecting from the DLL?


Marco Kalter
Allround Automations
Re: Unable to connect from DLL
Marco Kalter #59191 12/12/18 09:51 PM
Joined: Apr 2006
Posts: 10
M
Member
Offline
Member
M
Joined: Apr 2006
Posts: 10
We're having a similar issue connecting from an Apache module loaded into Apache 2.4 (OHS 12.2.1.3) running on Windows 2012.
On the first connect attempt I'm getting:

Access violation at address 00007FFC88515014 in module 'oraclient12.dll'. Write of address 0000000000000018

Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.029s Queries: 15 (0.008s) Memory: 2.5585 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-04-23 12:45:54 UTC
Valid HTML 5 and Valid CSS