Rachael2211
Member
- Local time
- Today, 04:50
- Joined
- Oct 24, 2013
- Messages
- 33
Hi All,
My split application is used on an RDP in a multi-user environment. Field Access groups when they logon have the application launch then when they close out of it it disconnects them from the server/rdp. To do this I run a batch file just before the application.quit to disconnect user from server BUT...it doesn't kill the instance of MSaccess.exe for that user in the task manager SO...my though is to incorporate the shutting down of MSAccess.exe into the batch file and the "quit" button would just call it instead of calling it then using application.quit which I dont think executes because the batch file disconnects user first.
Heres my closing routine from a button on the menu of my application:
Function IsMember(strDomain As String, strGroup _
As String, strMember As String) As Boolean
Dim grp As Object
Dim strPath As String
strPath = "WinNT://" & strDomain & "/"
Set grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function
Function GetCurrentUser() As String
GetCurrentUser = Environ("USERNAME")
End Function
Function GetCurrentDomain() As String
GetCurrentDomain = Environ("USERDOMAIN")
End Function
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
If IsMember(GetCurrentDomain, "FIELD ACCESS", GetCurrentUser) Then
Shell ("C:\BusiVine\Shutdown.bat")
Application.Quit
Else
Application.Quit
End If
Exit_cmdCancel_Click:
Exit Sub
Err_cmdCancel_Click:
Resume Exit_cmdCancel_Click
End Sub
Here is my thoughts for the batch and getting rid of the application.quit line:
@echo off
taskkill /im MSACCESS.EXE /t /f
Shutdown /l /f
I know the shutdown line works but am unsure about the correctness of the msaccess line, could some awesome expert person please give me the thumbs up that Im on the right track before I try to implement this on the server and give everyone a headache lol
thank you in advance, Rachael
My split application is used on an RDP in a multi-user environment. Field Access groups when they logon have the application launch then when they close out of it it disconnects them from the server/rdp. To do this I run a batch file just before the application.quit to disconnect user from server BUT...it doesn't kill the instance of MSaccess.exe for that user in the task manager SO...my though is to incorporate the shutting down of MSAccess.exe into the batch file and the "quit" button would just call it instead of calling it then using application.quit which I dont think executes because the batch file disconnects user first.
Heres my closing routine from a button on the menu of my application:
Function IsMember(strDomain As String, strGroup _
As String, strMember As String) As Boolean
Dim grp As Object
Dim strPath As String
strPath = "WinNT://" & strDomain & "/"
Set grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function
Function GetCurrentUser() As String
GetCurrentUser = Environ("USERNAME")
End Function
Function GetCurrentDomain() As String
GetCurrentDomain = Environ("USERDOMAIN")
End Function
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
If IsMember(GetCurrentDomain, "FIELD ACCESS", GetCurrentUser) Then
Shell ("C:\BusiVine\Shutdown.bat")
Application.Quit
Else
Application.Quit
End If
Exit_cmdCancel_Click:
Exit Sub
Err_cmdCancel_Click:
Resume Exit_cmdCancel_Click
End Sub
Here is my thoughts for the batch and getting rid of the application.quit line:
@echo off
taskkill /im MSACCESS.EXE /t /f
Shutdown /l /f
I know the shutdown line works but am unsure about the correctness of the msaccess line, could some awesome expert person please give me the thumbs up that Im on the right track before I try to implement this on the server and give everyone a headache lol
thank you in advance, Rachael