Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Kicking users out of a database.

Posted on 2004-09-15
6
Medium Priority
?
1,040 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 1000 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 1000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

886 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