[quote=343450:@Greg O’Lone]
App.Quit would do it, but I think you’re thinking about this backwards. Typically if you have users online all the time, you would do your manipulations in a copy of the database, record the changes that are being made and then apply them to the live copy during an upgrade maintenance period.[/quote]
Well usually the way you have to close apps is trough closing the opened window in the case of windows and standalone or killing the app, and by doing that i guess the close event never fires so that i can put there database disconnection and closing .
I did tried a user stopping alternative by putting this in a admin control and firing this ,
[code]For i As Integer = 0 To App.SessionCount-1
App.SessionAtIndex(i).MsgBox(“Please save your work, we will shutdown after 1 minute for maintenance update.” + EndOfLine + “Thank you.”)
Next
shutdownTimer.Mode = Timer.ModeSingle[/code]
and the timer event has :
[code]For i As Integer = 0 To App.SessionCount-1
App.SessionAtIndex(i).MsgBox(“We are shutting down now.”)
App.SessionAtIndex(i).Quit
Next
If App.SessionCount = 0 Then
Session.fmsDB.Close
Else
Return
End If
[/code]
But it seems that unless the user press ok on each popup the event never fires, or at least one has to press ok, this is what i found,
And the funny part is that on mac it does closes the databases properly and does all the cleaning and closing, while on the windows side it does not do that , so the way i doit now i modified the SQLite backup app from samples and i copy as you said all those files on a mac on disk and open the db, do the backup , creates a single file db and then i delete the old one and put the new one.
So still tweaking to be done but i guess i`m close.
I did put a timeout on the app so that the session gets closed for the users that stay logged in but i guess i did it wrong as it never works.
Basically i need if nothing happens after a while , 3 min let`s say to get signed out and back to login page.
Thanks again.