Page 1 of 1

Problem with TOraStoredProc in DLL

Posted: Thu 19 Feb 2009 10:30
by Yuriy
I've a problem with used the torastoredproc in dll for Delphi 2009 (ODAC 6.70 trial).
I was trying with a demo dll in direct mode:

Code in Dll:
procedure ShowForm; cdecl;
begin
InitNet;
with TfmDllMain. Create (Application) do
begin
OraStoredProc. Session: = ExternalSession;
ExternalSession. Connect;
OraStoredProc. StoredProcName: = ' ODACPACK.GetDeptFunc ';
OraStoredProc. PrepareSQL;
OraStoredProc. Open;
Show;
end;
end;

Error message: "Invalid class typecast"

-- I've same problem with UniDac library (tunistoredproc, demo simple dll)

Thanks for any help!

Posted: Fri 20 Feb 2009 08:57
by Plash
You should use a separate TOraSession component and call the AssignConnect method to make the component use the physical session from the external TOraSession component:

OraSession.AssignConnect(ExternalSession);

We will add the same method to TUniConnection component in one of the next builds of UniDAC.

Posted: Fri 20 Feb 2009 11:18
by Yuriy
Many thanks for help!