Hi John,
In what way is my answer slightly different than what you are looking for,
other than splitting the database? Splitting your application into a
front-end (FE) and back-end (BE) databases is a pre-requisite for a
multi-user Access database. You *really* should do this. Trust me on that.
Each user should have their own copy of the FE database installed to their
local hard drive. The BE database, which includes only tables with the shared
data, is placed on the file server. I honestly do not think it is possible to
implement the ability to boot off a given user with a shared database, when
everyone is sharing the entire database. Think about it...if it shuts down
for one user, it shuts down for all users.
I took a look at this sample. The directions include one step that you did
not mention in your initial message. Step 5 includes the following
instruction:
"Also you will need to place a linked table name in the
function "Find_Current_BE_Location". This will allow the
program to determine where your BE's lock file is located."
The "Find_Current_BE_Location" function is found in the code module
associated with the frmDatabaseAdministration form. Here is the comment line,
with the line of code that you need to modify:
' Place a table name in the next line that is a linked table.
CourtConnection = CurrentDb.TableDefs("tblCity").Connect
If you happen to have a table named tblCity, then great. Otherwise, replace
this value with the name of an existing linked table. This code simply will
not work unless you specify a LINKED table, which means that you need to
split the database. The reason is that local tables do not include a .Connect
string. Thus, the string variable CourtConnection would be null.
The Form_Open event procedure of frmDatabaseAdministration includes a call
to the subroutine named "btnTest_Click":
Call btnTest_Click
This subroutine includes the following line of code:
DB_BE_Path_And_Name = Find_Current_BE_Location
which causes the above mentioned Find_Current_BE_Location function to be
run. The next line of code in the btnTest_Click procedure:
DB_BE_LockFile = Left$(DB_BE_Path_And_Name$, Len(DB_BE_Path_And_Name) - 4)
would result in a null, since you have not back-end database until you split
your database. With enough time, the necessary modifications could be made
to this code to run in a local database. If you are using Access 2000 or
higher, you can get the path by using CurrentProject.Path. Then, you would
use the replace function (Access 2000 & higher) to replace the string ".mdb"
with the string ".ldb".
You won't need to do all these modifications to the code, if you will simply
split your database!
Tom
__________________________________________
:
Unfortunately I couldn't use your prior answer because it's slightly
different than what I'm looking for. I simply want to boot or force off any
access user. But, I’ll wait for your response tonight regards to the link I
provided. Thanks Tom.
John
__________________________________________
:
Hi John,
Thanks for providing the link. I will take a look at this later tonight. I'm
just getting ready to leave for work now. Did my other answers help you
answer your questions?
Tom
__________________________________________
:
Hi Tom,
My question is refering to the "Force user Out" located:
http://propertychampion.com/Developer_Tools/Addins/Addins.html
Regards..
John
__________________________________________
:
Hi John,
It would be helpful if you can provide a reference for the method that you
are using. Are you getting this from an on-line source, from an Access book,
etc. That way, if someone has the same reference material available, they can
take a better look at the issue for you. I have used the method shown in this
KB article with success:
HOW TO: Detect User Idle Time or Inactivity in Access 2000
http://support.microsoft.com/?id=210297
However, I replaced the code in one subroutine, as follows:
Sub IdleTimeDetected(sngExpiredMinutes)
'Dim strMessage As String
'strMessage = "No user activity detected in the last" & vbCrLf
'strMessage = strMessage & sngExpiredMinutes & " minute(s)!"
'MsgBox strMessage, vbInformation, "No Sign of Activity!"
Application.Quit acSaveYes
End Sub
Arvin Meyer has a sample available here:
http://www.datastrat.com/Download2.html
Look for KickEmOff2K - Demo of Kick Em Off Code
Just to give a little light on how my database is designed: I don't have
any front end and back end options for the users. They simply share the
database thru a shared network drive (no splits yet).
You really should split your database. Sharing an entire database on the
network has been identified by Microsoft personnel as the # 1 cause of
corruption in Access.
1.) > Ok, I imported "tbleUserPreferences" table into my database. However,
how do I link it?? do I ignore it, since I don't have front end??
Linking is used in reference to a split database. You should not ignore it.
Instead, you should split your database.
2.) > I think I did this part fine by simply importing them.
Sounds right.
3.) > 3. In the On_Open Event of your Switchboard place the following Code.
Dim stDocName As String
stDocName = "frmNotifyUser"
DoCmd.OpenForm stDocName,,,,, acHidden
Here again I got stuck. I have a switchboard, and I click the design button
to click the on_open event. I did select the [Event Procedure] and clicked
the ... build button to type the above code. I don't know where and if I
should type all exactly the same as it appears??
Was your switchboard created using the switchboard wizard? If so, you
already have a Form_Open event procedure, so you would add those lines of
code to the existing procedure. If you did not already have a Form_Open event
procedure, then as soon as you clicked on the build button (the button with
the three dots), you should have seen your mouse cursor positioned within
these two lines of code:
Private Sub Form_Open(Cancel As Integer)
<--blinking cursor here
End Sub
Copy the three lines of code and paste them in-between the Private Sub
Form_Open and End Sub lines. Then click on Debug > Compile DatabaseName to
verify that your code compiles okay.
Tom
__________________________________________
:
Hi everyone,
I encountered some problems and confusions while following the step by step
process using the "force a user out" to incorporate into my Access XP
database.
Just to give a little light on how my database is designed: I don't have any
front end and back end options for the users. They simply share the database
thru a shared network drive (no splits yet).
There are 4 steps to follow to complete the process.
1. Place the table "tblUserPreferences" in your back end and link to it
from your front end.
Ok, I imported "tbleUserPreferences" table into my database. However, how
do I link it?? do I ignore it, since I don't have front end??
2. Part instructs to import the three forms: "frmDatabaseAdministration",
"frmForceUserOut" and "frmNotifyUser" into my front end.
I think I did this part fine by simply importing them.
3. In the On_Open Event of your Switchboard place the following Code.
Dim stDocName As String
stDocName = "frmNotifyUser"
DoCmd.OpenForm stDocName,,,,, acHidden
Here again I got stuck. I have a switchboard, and I click the design button
to click the on_open event. I did select the [Event Procedure] and clicked
the ... build button to type the above code. I don't know where and if I
should type all exactly the same as it appears??
After this I should be able to make this run correct? Can you please also
tell me how I can test it on a shared network?? Thank you for your time.
John