Problem with TOraStoredProc in DLL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Yuriy
Posts: 2
Joined: Thu 19 Feb 2009 10:17

Problem with TOraStoredProc in DLL

Post by Yuriy » Thu 19 Feb 2009 10:30

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!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 20 Feb 2009 08:57

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.

Yuriy
Posts: 2
Joined: Thu 19 Feb 2009 10:17

Post by Yuriy » Fri 20 Feb 2009 11:18

Many thanks for help!

Post Reply