Solved

Kicking users out of a database.

Posted on 2004-09-15
6
1,017 Views
Last Modified: 2012-05-05
I am working with a shared database (not secured).  I have the ability to see who is in my database by using the following code:
Function ShowUserRosterMultipleUsers()
    Dim cn As New ADODB.Connection
    Dim cn2 As New ADODB.Connection
    Dim RS As New ADODB.Recordset
    Dim i, j As Long

    cn.Provider = "Microsoft.Jet.OLEDB.4.0"
    cn.Open "Data Source=T:\Operations\Funding Reports\Funding & Wire Acct Reports\Commercial Funding\Secured.mdw"
        cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
    & "Data Source=T:\Operations\Funding Reports\Funding & Wire Acct Reports\Commercial Funding\Secured.mdw"

    Set RS = cn.OpenSchema(adSchemaProviderSpecific, _
    , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

    Debug.Print RS.Fields(0).Name, "", RS.Fields(1).Name, _
    "", RS.Fields(2).Name, RS.Fields(3).Name

    While Not RS.EOF
        Debug.Print RS.Fields(0), RS.Fields(1), _
        RS.Fields(2), RS.Fields(3)
        RS.MoveNext
    Wend

End Function


I want to be able to kick users out one at a time and/or all at the same time.  These individuals are very sensitive so I don't want to just kill their access.  Is there a way that I can notify them that they will be kicked out prior to actually doing it?
0
Comment
Question by:Hermanifer
6 Comments
 
LVL 9

Accepted Solution

by:
tonydemarco earned 250 total points
ID: 12070360
Hermanifer,

Since your good at the code, I'll give you he concept.
Set an on timer event in a form that looks up (DLookup) a value in a table.(timeout_tbl)

If there is a value " IF Not ISNULL table.timeout_tbl.timeout " Then
DoCmd.Openform "Warning_frm"
Else
Exit Sub

The Warning_frm has a label that says:
"Application is being shut down in 1 min for updates. Please complete your work now"
The form is pop up modal and has no close button.
This form has an OnTimer Event that closes the app "DoCmd.CloseApp"

Now all you have to do is place a value in the timeout_tbl that the first form looks for in the DLookup.

Hope this helps

0
 

Author Comment

by:Hermanifer
ID: 12095460
That's really the problem.  I'm not good at the code.  I need a good road map on how to do this.
0
 
LVL 2

Assisted Solution

by:Rich292
Rich292 earned 250 total points
ID: 12122073
Hi Hermanifer

I came across a site the other day, which has a step by step guide called: Build an Automatic User Log Off Procedure in Your MulitUser Application.  

http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm

From the menu, select MS Access Code Design and Tips, then click on the Multi-User link

Have not tried to see if it works, but see how you go.
Hope this helps

Rich
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question