Jump to content

How can i access UniSession in UniMainModule?


A_MU
 Share

Recommended Posts

I need to write Log when UniMainModule Destory,so i write some code:

 

procedure TUniMainModule.UniGUIMainModuleDestroy(Sender: TObject);

begin

with uniMainModule.OraQry_common do

begin

close;

sql.Clear;

sql.Add('update aks_ldap_log set logouttime='+#39+MyDayToStr(now)+#39+' where staff_id='+get_id_str(uniMainModule.UserInfo.User)+

' and Session_ID='+#39+UniApplication.UniSession.SessionID+#39);

uniMainModule.OraSession_master.StartTransaction;

try

execsql;

uniMainModule.OraSession_master.commit;

except on e:exception do

begin

uniMainModule.OraSession_master.Rollback;

showmessage('Write Log Fail'+#13#10+e.Message);

end;

end;

end;

 

if DBConn_State then OraSession_Master.Close;

 

end;

 

But Compile fail,[DCC Error] MainModule.pas(208): E2003 Undeclared identifier: 'UniSession'

 

Of cause,i write code

........................

var

DBConn_State:boolean;

 

implementation

 

{$R *.dfm}

 

uses

UniGUIVars, ServerModule, uniGUIApplication;

..........................

HOW CAN I DO?

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...