Solved

Kicking users out of a database.

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

863 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

26 Experts available now in Live!

Get 1:1 Help Now