Solved

Kicking users out of a database.

Posted on 2004-09-15
6
1,011 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now