Page 1 of 1
Calling a DLL with NET option activated
Posted: Mon 12 Dec 2005 08:56
by wchris
Since the two or three last ODAC versions we have problems when calling a dll with .net option activated.
We get the error message OCI_INVALID_HANDLE.
When using the oracle client everything is fine.
Any idea ?
Posted: Mon 12 Dec 2005 13:40
by Paul
We did not encountered with this problem.
Please send us complete sample to demonstrate it and include script to create server objects (tables) to ODAC support address. Please specify versions of Delphi, Oracle server.
Posted: Mon 19 Dec 2005 14:02
by wchris
hello again,
It took some time to build the sample...
It's a modified version of the DLL demo project shipped with ODAC
The following changes :
- We are using options.net := true
- We have a datamodule in the dll containing another Torasession
- We are using the assignconnect command to assign the session in the datamodule
The advantages :
We have many tables and stored procs in datamodules... having a Torasession as a visual component does not require such command in the source code :
OraQuery.session := Externalsession
because everything is done visualy in components. But then the assignconnect command is needed.
The problem :
When setting options.net := false everything is OK
When setting options.net := true we get message 'INVALID_OCI_HANDLE'
I'm available for more information if you need
Thanks
Posted: Mon 19 Dec 2005 15:16
by wchris
Tip :
To use my sample you must change the connection informations in the Torasession to put yours, and change the select clause in the toraquery to use one of your tables instead of mine.
good luck
Posted: Tue 20 Dec 2005 08:16
by Paul
You must include OraNet to the uses clause of DLLMain.pas and call InitNet procedure instead of InitOCI in ShowForm.
Posted: Tue 20 Dec 2005 09:12
by wchris
Hello,
Thank you for the fast answer, i'll try this as soon as possible and tell you if it's ok.
Have a nice day.
Posted: Fri 23 Dec 2005 09:17
by wchris
Hello,
We added the units in the uses list, and the following test in the DLL.
if (Wsession.Options.Net = False) then
InitOCI
else
InitNet;
Now everything is working fine.
Thanks a lot.
We wish you a Merry Christmas
and a happy New Year.
Best Regards
Chris