Preventing users accessing the database

SueBK

Registered User.
Local time
Today, 16:26
Joined
Apr 2, 2009
Messages
197
If I need to take the backend of my database offline for changes, what's the best/easiest way to inform the users?

Is there some code I can drop into the front end? I'm thinking a "on database open, if [available] in tblClose equals no, then open frmDatabaseOffLine". But I don't know a) if that's possible or b) how to program it.
 
Assuming the FE reconnects to the BE each time it is opened, another fairly simple way to achieve this is by having a table with one field that holds a value which indicates whether the BE is online or offline. When the user's FE opens and connects to the BE, to start with it only connects to this table and checks the value, if ok it drops this table and connects to the remaining tables and loads as normal, otherwise you can use a Msgbox to inform users that the BE is down and to try again later and it quits.
David
 
Jdraw
Thanks for your post actually it is an easier way from what I am doing even thought my code is working perfect but still I found your suggestion much easier to be done
Thanks again
 
I think this is a basic question, but I'm pretty much stumped - how do I attach code to the opening of the database?

I have a form that opens on start up and I tried adding code to it's 'on open'. But I can't work out how to do it. I created a table called 'tblAvailable' with a yes/no field 'available' and text field called 'message'. I created a form called 'frmAvailable', with the message field on it. I tried code that said (from memory)

if [available] = yes then
docmd.openform frmAvailable


I had two issues - first it didn't seem to recognise my if statement, then it would open the second form, but behind the first one where users wouldn't notice it.

So, I have two questions:
- how do you word if statements for yes/no fields?
- can I close the current startup form as part of my code? I assume if I can run this on database open that would solve the issue - I'd simply have "if [available] yes, open frmAvailable, otherwise open frmstartup.
 
start with a macro and name it specifically autoexec, this will run at startup before anything else happens and all you need to do is call a function using the RunCode command in the macro.
"how do you word if statements for yes/no fields" if they're boolean then just use
If myBooleanVar = True ....
"can I close the current startup form as part of my code? " If you create a function call it StartUp and call it from the autoexec macro, you can now control the opening/loading events from StartUp() until you want to pass event control to another object in your database, depends on your design really and how you want it to work
David
 

Users who are viewing this thread

Back
Top Bottom