Rx_
Nothing In Moderation
- Local time
- Today, 12:55
- Joined
- Oct 22, 2009
- Messages
- 2,803
The BoostPriority does upgrade the Windows Priority thread on Windows 7.
Can anyone try this script on Windows Server (2003 or later) to let me know if it works there? Tell me what OS and the bits (32/64).
My environment is MS Access 2010 Front-End with DSN-Less connections to a SQL Server Back End. For developement Access runs on a desktop. For Production, MS Access runs on a dedicated virutal Windows Server and is distributed via Citrix. The application is used all over the US on both Windows and the latest Apple systems. In addition, as script runs on the serve so each user has their own personal copy of Access Front End.
The bigger reports require a lot of regulatory processing. The longer report can take 4 to 12 minutes. The acutal time is logged in a table.
Since the server is dedicated to MS Access (with some Excel automation) it makes sence to boost the priority.
Running the longer report from my Development Desktop took about 9 minutes. With the priority boost, it took a little over 2 minutes.
Note - This is probably due to bringing selected data to temp tables - then running as many as 5 cursors for regulatory situations per record. For this unique situation - the Priority Boost made a huge difference on Win 7 OS. Other reports with SQL Pass-through queries showed no difference at all. Boosting Priority is not a "one-size-fits-all" solution.
Just wondering if someone can test this on a Windows Server OS before I push this out to a production server that another group maintains.
Can anyone try this script on Windows Server (2003 or later) to let me know if it works there? Tell me what OS and the bits (32/64).
My environment is MS Access 2010 Front-End with DSN-Less connections to a SQL Server Back End. For developement Access runs on a desktop. For Production, MS Access runs on a dedicated virutal Windows Server and is distributed via Citrix. The application is used all over the US on both Windows and the latest Apple systems. In addition, as script runs on the serve so each user has their own personal copy of Access Front End.
The bigger reports require a lot of regulatory processing. The longer report can take 4 to 12 minutes. The acutal time is logged in a table.
Since the server is dedicated to MS Access (with some Excel automation) it makes sence to boost the priority.
Running the longer report from my Development Desktop took about 9 minutes. With the priority boost, it took a little over 2 minutes.
Note - This is probably due to bringing selected data to temp tables - then running as many as 5 cursors for regulatory situations per record. For this unique situation - the Priority Boost made a huge difference on Win 7 OS. Other reports with SQL Pass-through queries showed no difference at all. Boosting Priority is not a "one-size-fits-all" solution.
Just wondering if someone can test this on a Windows Server OS before I push this out to a production server that another group maintains.
Code:
Option Compare Database
Option Explicit
Public Sub BoostPriority()
' Rx_ example: substitute msaccess.exe with notpad.exe
' Start application, use Windows Task Manager to check before/after
Dim strComputer As String
Dim objWMIService As Object
Dim colProcesses As Object
Dim objProcess As Object
Const ABOVE_NORMAL = 32768
Const HIGH = 128
10 strComputer = "."
20 Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
30 Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'msaccess.exe'")
40 For Each objProcess In colProcesses
50 objProcess.SetPriority (ABOVE_NORMAL)
60 Next
70 Set objWMIService = Nothing
80 Set colProcesses = Nothing
90 Set objProcess = Nothing
End Sub
Public Sub GetOperatingSystemInfo(strKeyValue As String)
' We are using late binding
Dim objWMIService As Object
Dim colItems As Object
Dim objItem As Object
Dim strWMINamespace As String
Dim strComputer As String
Dim strWMIQuery As String
10 strComputer = "."
' Rx_ I have not found values for Windows 2003 Server or later
20 strWMINamespace = "\root\CIMV2"
' Use strKeyValue to specify the value of the Key Property to get the "instance"
' of the Win32_OperatingSystem Class in order to get the Property Values
30 strWMIQuery = ":Win32_OperatingSystem.Name='" & strKeyValue & "'"
40 Set objWMIService = GetObject("winmgmts:\" & strComputer & strWMINamespace & strWMIQuery)
50 For Each objItem In objWMIService.Properties_
60 Debug.Print objItem.Name & ": " & objItem.Value
70 Next
' Release Memory
80 Set objItem = Nothing
90 Set colItems = Nothing
100 Set objWMIService = Nothing
End Sub
Last edited: