Solved

Kicking users out of a database.

Posted on 2004-09-15
6
1,030 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
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…

621 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