Reuse session from Devoloper forms?

I have a delphi vith DOA application that I call from a developer 2000 ver. 6 form. Is there a method for "handing over" the session information to DOA in order to avoid a new logon process to be initiated from the Delphi program?

------------------
busk
 
What's about using the ExternalLDA-property of TOracleSession.
Using this property connects an Session to the Logon Data Area of an other session.

Oli
 
This is a bit complicated.
I can give a basic outline to start. Let me know if you need more.
----------------

First, you have to create a user-exit DLL with a function that uses OCI or SQL libraries to get the LDA handle. The pointer or handle must then be passed back to Forms. Typically this is done by call the functions to set a variable value in forms.

We have found converting the address to a string is the most reliable way to handle this. Forms often had problems with numeric values, usually in issue of byte size.

Once the address is in Forms, Forms can use a foreign-function call to use a Delphi DLL, and pass the address string. Delphi can convert the string to a number and then typecast the number to a pointer type. Assign the pointer value to the ExternalLDA property and the Session in the DLL will be the same as the Forms session.

We usually have a procedure in the Delphi DLL:

procedure SetLDA(LDAStr : Pchar);
begin
OracleSession.ExternalLDA := Pointer(StrToInt(LDAStr));
end;

Good Luck...

Charlie.
 
Back
Top