A_MU Posted January 19, 2012 Share Posted January 19, 2012 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? Quote Link to comment Share on other sites More sharing options...
A_MU Posted January 19, 2012 Author Share Posted January 19, 2012 Sorry,I resolved it Quote Link to comment Share on other sites More sharing options...
asapltda Posted July 4, 2012 Share Posted July 4, 2012 Sorry,I resolved it hello, I could write that he found the right solution? Quote Link to comment Share on other sites More sharing options...
MassimoD Posted November 8, 2022 Share Posted November 8, 2022 On 7/4/2012 at 8:04 AM, asapltda said: hello, I could write that he found the right solution? i've done a Type Cast like procedure TUniMainModule.OnMainModuleCreate(Sender: TObject); begin ... TUniGUIApplication(UniApplication).UniSession ... end; and it worked for me. Bye Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.