[AccessD] How to tell how much resources have been used

jack drawbridge jackandpat.d at gmail.com
Sun Jun 7 07:21:49 CDT 2015


Bill,

I have never used the api and am not familiar with it.
I did find this from years ago re negative values.
http://bytes.com/topic/access/answers/208402-a97-why-negative-memory-values-reported

And this:
http://stackoverflow.com/questions/19550367/access-2010-system-resource-exceeded

Good luck.

On Sun, Jun 7, 2015 at 7:58 AM, Bill Benson <bensonforums at gmail.com> wrote:

> Recently I had some problems with Access consuming too many "resources"
> when trying to output some reports to disk consecutively, using VBA. I
> wrote a routine that interrupted the process at various stages and
> suggested the user quit Access and restart the database, then on startup,
> looks for where things left off and continues. Even though this mitigates
> risk, it is still possible for Access to run out of resources along the way
> at any particular stage it happens to open up and carry on from. I creating
> an alternative that automates a second instance of Access to run the
> reports. However this will add a significant amount of time to the running
> process. I would like therefore to know if there is a way to test how much
> RAM is being used by a process in order to permitting the 2nd instance to
> crank out reports up until an optimal stopping point.
>
> I found some code here https://goo.gl/g8ZkTT that purports to find the
> amount of available memory (plus a whole lot of other info) however (1) the
> amount is always being reported as a negative number (e.g.,
>
>       ?MemoryAvailable
>       -475230208
>
> Also, I am wondering if I would have to enhance the API definitions in
> order to accommodate Windows 8.1, which my Firm is movint towards.
>
> Anyone have experience with this API call and how to cover the bases I am
> conderned with?
>
> Option Compare Database
> Option Explicit
> Type MEMORYSTATUS
>     dwLength As Long
>     dwMemoryLoad As Long
>     dwTotalPhys As Long
>     dwAvailPhys As Long
>     dwTotalPageFile As Long
>     dwAvailPageFile As Long
>     dwTotalVirtual As Long
>     dwAvailVirtual As Long
> End Type
> Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As _
>             MEMORYSTATUS)
>
> Function MemoryAvailable()
> Dim msg As String         ' Status information.
> Dim NewLine As String     ' New-line.
> Dim ret As Integer        ' OS Information
> Dim ver_major As Integer  ' OS Version
> Dim ver_minor As Integer  ' Minor Os Version
> Dim Build As Long         ' OS Build
> Dim memsts As MEMORYSTATUS
> GlobalMemoryStatus memsts
> MemoryAvailable = memsts.dwAvailPhys
> 'MemoryAvailable = memsts.dwLength
> 'MemoryAvailable = memsts.dwMemoryLoad
> 'MemoryAvailable = memsts.dwTotalPhys
> 'MemoryAvailable = memsts.dwAvailPhys
> 'MemoryAvailable = memsts.dwTotalPageFile
> 'MemoryAvailable = memsts.dwAvailPageFile
> 'MemoryAvailable = memsts.dwTotalVirtual
> 'MemoryAvailable = memsts.dwAvailVirtual
> End Function
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list