Basic Client Server (1 Viewer)

neil_turner

Registered User.
Local time
Today, 20:14
Joined
Mar 4, 2002
Messages
16
Hi All,

I've just a quick question with making an application client server. So far all the code I've written is for the front end application, which from what I have read is waht gets relesed to the user. However I want to write some marshelling code that will check the status of a table at midnight and clear out any sessions that are still enabled. Although I only want this on the server. Is there a way to make a module server side specific? Or would it be a case of writing extra functionality to the front end for a server super user that can be left running at all times?

Any comments or suggestions greatly appreciated as I've never split an access DB into client server within Access!

Thanks

Neil
 
1.
The frontends can not only log out on their own, they can not be "terminated" from the outside. On the bottom you will find one of the possible solutions for this problem. You might add a routine that logs out the users at a certain time, lets say 2 am.
2.
You might initiate any maintenance procedure from another "front end" file residing on the server. Since your procedure is time related this front end will need to run all the time.

----------------------------------------------------
Here is the code to logout users automatically (stolen from www.unsoftwareag.com):
ACCESS ONLINE ENCYCLOPEDIA Article Code: N2

How do I log out all users remotedly ?
From time to time it is necessary that all logged-in users leave the application in order to maintain or backup the backend.
The remote log out can be automatised in simply changing one single value in a table field of the backend.
The following steps are necessary:


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.
If you want shut down an idle application automatically then have a look at PowerUp Solution M29.
 

Users who are viewing this thread

Back
Top Bottom