thucgia > 28-09-15, 12:52 AM
Option Compare Database
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
Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
Declare Sub abGlobalMemoryStatus Lib "kernel32" Alias "GlobalMemoryStatus" (lpBuffer As MEMORYSTATUS)
Sub GetSysInfo()
Dim intMousePresent As Integer
Dim strBuffer As String
Dim intLen As Integer
Dim MS As MEMORYSTATUS
Dim SI As SYSTEM_INFO
'Set the length member before you call GlobalMemoryStatus
MS.dwLength = Len(MS)
abGlobalMemoryStatus MS
Debug.Print "MemoryLoad : " & MS.dwMemoryLoad & "%"
Debug.Print "TotalPhysical : " & Format(Fix(MS.dwTotalPhys / 1024), "###,###") & "K"
Debug.Print "AvailablePhysical : " & Format(Fix(MS.dwAvailPhys / 1024), "###,###") & "K"
Debug.Print "TotalVirtual : " & Format(Fix(MS.dwTotalVirtual / 1024), "###,###") & "K"
Debug.Print "AvailableVirtual : " & Format(Fix(MS.dwAvailVirtual / 1024), "###,###") & "K"
Debug.Print "-------------------end-------------------------------"
End Sub
'GetMemorySize.GetSysInfo
Private Sub btn_them_Click()
'Dim h As HsinhDto
'GetMemorySize.GetSysInfo
'Set h = New HsinhDto
' For i = 3001 To 4000
' h.ten = "ten " & i
' h.lop_id = 1
' Call HsinhAdo.Them(h)
' Me.load_form
' Next i
'Set h = Nothing
'GetMemorySize.GetSysInfo
cmd = "add"
DoCmd.OpenForm "F_phieu_hs"
End Sub
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 090 164K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 677 572K
-------------------end-------------------------------
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 087 660K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 675 524K
-------------------end-------------------------------
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 075 316K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 673 452K
-------------------end-------------------------------
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 072 908K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 676 528K
-------------------end-------------------------------
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 080 816K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 676 544K
-------------------end-------------------------------
MemoryLoad : 62%
TotalPhysical : 2 097 151K
AvailablePhysical : 1 078 524K
TotalVirtual : 2 097 024K
AvailableVirtual : 1 675 440K
-------------------end-------------------------------