Hey guys,
I was browsing through previous threads and found one regarding automatically logging off database users before maintenance.
The thread is as follows:
Create a field [LogOutStatus] in a system table of the backend that holds the values 1, 2 or 3
Create a form in the frontend that stays open permanently (hidden)
Activate the timer interval of this form
Write code for the OnTimer event to control the field [LogoutStatus]
Write code to leave the frontend
Write code to verify the content of [LogOutStatus] on opening the frontend
The functioning:
The OnTimer-Event checks the value of [LogOutStatus]:
1 = nothing
2 = Display message "Application will shut down in a moment
3 = Another message Message if desired and closing frontend
On opening the frontend the same test has to be made.
Code examples:
Ontimer-Event select case dlookup("[LogOutStatus]","tblSystem"
case 1
' nothing
case 2
call MessageBeforeShutDown
case 3
' special Code for your application
application.quit
end select
Sub MessageBeforeshutdown
dim strMessage as string
strMessage="ATTENTION: The database has to be shut down in 5 minutes" _r> & "Please finish your work and leave the program."
msgbox strMessage
end sub
Please note:
- The time between changing the value of [LogOutStatus] and the shut-down of the frontends depends on the setting of the timer interval
- You need to control via VBA that the data manipulation will be terminated correctly
- All open objects have to be closed on shut-down
- You need to inform the users when the application is up again.
'------------
However, I do not comprehend how to manipulate the LogOutStatus setting using the OnTimer Event Procedure.
Also I am not clear as to how all these procedures are activated.
Could someone PLEASE expand on this entire process for me?
Thanks
Dominic
I was browsing through previous threads and found one regarding automatically logging off database users before maintenance.
The thread is as follows:
Create a field [LogOutStatus] in a system table of the backend that holds the values 1, 2 or 3
Create a form in the frontend that stays open permanently (hidden)
Activate the timer interval of this form
Write code for the OnTimer event to control the field [LogoutStatus]
Write code to leave the frontend
Write code to verify the content of [LogOutStatus] on opening the frontend
The functioning:
The OnTimer-Event checks the value of [LogOutStatus]:
1 = nothing
2 = Display message "Application will shut down in a moment
3 = Another message Message if desired and closing frontend
On opening the frontend the same test has to be made.
Code examples:
Ontimer-Event select case dlookup("[LogOutStatus]","tblSystem"
case 1
' nothing
case 2
call MessageBeforeShutDown
case 3
' special Code for your application
application.quit
end select
Sub MessageBeforeshutdown
dim strMessage as string
strMessage="ATTENTION: The database has to be shut down in 5 minutes" _r> & "Please finish your work and leave the program."
msgbox strMessage
end sub
Please note:
- The time between changing the value of [LogOutStatus] and the shut-down of the frontends depends on the setting of the timer interval
- You need to control via VBA that the data manipulation will be terminated correctly
- All open objects have to be closed on shut-down
- You need to inform the users when the application is up again.
'------------
However, I do not comprehend how to manipulate the LogOutStatus setting using the OnTimer Event Procedure.
Also I am not clear as to how all these procedures are activated.
Could someone PLEASE expand on this entire process for me?
Thanks
Dominic