ukaquanaut
Registered User.
- Local time
- Today, 12:47
- Joined
- Feb 8, 2012
- Messages
- 33
Hi
I used Access to develop a 2D label printing App connected to my clients ERP system. We use Bartender Label Printing to automate the Barcode printing and this all, in general works really well, over 3 millions labels printed from in WW.
This requires Bartender automation system to be ready to go and occasionally its not the background services stop and printing halts. Some of the users have got used to restarting the Bartender background process using the Bartender Utilities, but this is not a realistic process for some users to go of the Access App and use the other utilities in Windows.
Therefore I have added a monitor page to the Access App to indicate when a Bartender Process is not running, this works perfectly and the associated button to start the Windows Bartender Process also works as long as you run the Access as Administrator. Alas that's not really practical as certainly the Runtime Access appears not to respond that same way in this regard as the developer version of Access.
'---------- START Administrator -------------------------------------
Dim svc As Variant
Dim service As String
service = "BarTender Integration Service"
If Me.CmdP1Action.Caption = "Start" Then
MsgBox "INFO: Lets start process: " & service
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StartService
Exit For
Next
ElseIf Me.CmdP1Action.Caption = "Restart" Then
MsgBox "INFO: Lets Restart process: " & service
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StopService
Exit For
Next
Sleep (10000)
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StartService
Exit For
Next
End If
' ------------- END Administrator ----------------------------------
This is the code in a subroutine that I want to run with raised credentials as Administrator.
Does anyone know how to do this? I have seen other apps popup a box to get acknowledgement to raise credentials , but I have no idea how to get Access to do this
Many Thanks
Jerry Barrett
I used Access to develop a 2D label printing App connected to my clients ERP system. We use Bartender Label Printing to automate the Barcode printing and this all, in general works really well, over 3 millions labels printed from in WW.
This requires Bartender automation system to be ready to go and occasionally its not the background services stop and printing halts. Some of the users have got used to restarting the Bartender background process using the Bartender Utilities, but this is not a realistic process for some users to go of the Access App and use the other utilities in Windows.
Therefore I have added a monitor page to the Access App to indicate when a Bartender Process is not running, this works perfectly and the associated button to start the Windows Bartender Process also works as long as you run the Access as Administrator. Alas that's not really practical as certainly the Runtime Access appears not to respond that same way in this regard as the developer version of Access.
'---------- START Administrator -------------------------------------
Dim svc As Variant
Dim service As String
service = "BarTender Integration Service"
If Me.CmdP1Action.Caption = "Start" Then
MsgBox "INFO: Lets start process: " & service
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StartService
Exit For
Next
ElseIf Me.CmdP1Action.Caption = "Restart" Then
MsgBox "INFO: Lets Restart process: " & service
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StopService
Exit For
Next
Sleep (10000)
For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("SELECT * FROM Win32_Service WHERE Name='" & service & "'")
svc.StartService
Exit For
Next
End If
' ------------- END Administrator ----------------------------------
This is the code in a subroutine that I want to run with raised credentials as Administrator.
Does anyone know how to do this? I have seen other apps popup a box to get acknowledgement to raise credentials , but I have no idea how to get Access to do this
Many Thanks
Jerry Barrett