Kick users out of DB

dgmorr

Registered User.
Local time
Today, 11:13
Joined
Jan 10, 2007
Messages
71
Hey guys,

I'm curious to know if it is possible to kick users off your db so you can make changes. Is it possible to send them a message to save and close within 30 seconds, or just send them a messgae. I guess I want to know whether I can
1) Kick a user off
2) Send them a message
3) Send a user a message and then kick them off
 
Hey guys,

I'm curious to know if it is possible to kick users off your db so you can make changes. Is it possible to send them a message to save and close within 30 seconds, or just send them a messgae. I guess I want to know whether I can
1) Kick a user off
2) Send them a message
3) Send a user a message and then kick them off

Hey dgmorr,

Here's a link to Jeff Conrad's website. He has a whole section of links about "kicking users off." Maybe you will find one that it beneficial to you.

HTH,
Shane

http://home.bendbroadband.com/conradsystems/accessjunkie/kickoff.html
 
Thanks, those are some really good examples.

Now, is there a way I can link the computer name to the person's name through a table lookup?

I'm using this code, and not too sure how to interpret it

Code:
'will show all user's currently being connected to a database
'
'* based on information provided within the Microsoft KnowledgeBase *
Private Sub Transfer_UserRosterMultipleUsers(ByVal strPath_Filename_ToBackend As String)
   Dim cn As adodb.Connection
   Dim rs As adodb.Recordset
   Dim strRowSource As String
   Dim strUserToCheck As String
   
   Set cn = New adodb.Connection
   Set rs = New adodb.Recordset
   
   lstConnections.RowSource = ""
   DoCmd.Hourglass True
   
   With cn
      .Provider = "Microsoft.Jet.OLEDB.4.0"
      .Properties("Data Source") = mstrConnectedDB
      If mconfSecuredDB Then
         .Properties("User Id") = mcon_SEC_AdminsAcountName
         .Properties("Password") = mcon_SEC_AdminsAcountPWD
         .Properties("Jet OLEDB:System database") = getPath(mstrConnectedDB) & mcon_SEC_MDW_Name
      End If
      .Open
   End With
   
   'The user roster is exposed as a provider-specific schema rowset
   'in the Jet 4 OLE DB provider.  You have to use a GUID to
   'reference the schema, as provider-specific schemas are not
   'listed in ADO's type library for schema rowsets
   Set rs = cn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
   
   'Output the list of all users in the current database.
   strRowSource = ""
   '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)
      If mconfSecuredDB Then
         strUserToCheck = mcon_SEC_AdminsAcountName
      Else
         strUserToCheck = CurrentUser
      End If
      If Trim(rs.Fields(1)) = strUserToCheck Then
         'do not show the real name of the user that called this form
         strRowSource = strRowSource & _
            """" & getCleanedString(rs.Fields(0)) & """;""" & "[Caller of form]" & """;""" & _
               Choose(CBool(rs.Fields(2)) + 2, "Yes", "No") & """;""" & Nz(rs.Fields(3), "N/A") & """;"
      Else
         strRowSource = strRowSource & _
            """" & getCleanedString(rs.Fields(0)) & """;""" & getCleanedString(rs.Fields(1)) & """;""" & _
               Choose(CBool(rs.Fields(2)) + 2, "Yes", "No") & """;""" & Nz(rs.Fields(3), "N/A") & """;"
      End If
      rs.MoveNext
   Wend
   
   'cut off trailing ';' and transfer to listbox
   strRowSource = Left(strRowSource, Len(strRowSource) - 1)
   lstConnections.RowSource = strRowSource
   
   'clean up
   rs.Close: Set rs = Nothing
   cn.Close: Set cn = Nothing

   DoCmd.Hourglass False
End Sub
 

Users who are viewing this thread

Back
Top Bottom