Improve Db Performance in a Network Environ

Installing the following code into the first form that opens in a database will increase the database performance in a network environment, especially with Windows 7.

Option Compare Database
テつ
Public Function PrintISAMStats()
テつテつテつ ‘ Print the values returned by the ISAMStats function
テつテつテつ ‘ to the Debug window.
テつテつテつ
テつテつテつ Debug.Print “Number of disk reads: “, DBEngine.ISAMStats(0)
テつテつテつ Debug.Print “Number of disk writes: “, DBEngine.ISAMStats(1)
テつテつテつ Debug.Print “Number of reads from cache: “, DBEngine.ISAMStats(2)
テつテつテつ Debug.Print “Number of reads from read-ahead cache: “, DBEngine.ISAMStats(3)
テつテつテつ Debug.Print “Number of locks placed: “, DBEngine.ISAMStats(4)
テつテつテつ Debug.Print “Number of release lock calls: “, DBEngine.ISAMStats(5)
テつテつテつ Debug.Print
End Function
テつ
Public Function ResetISAMStats()
テつテつテつ ‘ This procedure resets the values returned by the
テつテつテつ ‘ ISAMStats function to zero.
テつテつテつ
テつテつテつ Dim intI As Integer
テつテつテつ ‘ Reset each value.
テつテつテつ For intI = 0 To 5
テつテつテつテつテつテつテつ DBEngine.ISAMStats intI, True
テつテつテつ Next
End Function
テつ
Public Function UpdateISAM()
テつテつテつ DBEngine.SetOption dbMaxBufferSize, 50000
テつテつテつ DBEngine.SetOption dbMaxLocksPerFile, 500000
テつ テつテつ‘DBEngine.SetOption dbFlushTransactionTimeout, 5000
テつテつテつ
End Function
テつ
Public Function runtest()
‘UpdateISAM
ResetISAMStats
Dim curtime As Date
curtime = Now
テつ
DoCmd.OpenForm “frmprc10claims”
PrintISAMStats
テつ
Debug.Print “Number of seconds:” & DateDiff(“s”, curtime, Now())
テつ
テつ
End Function

This entry was posted in Access 2007 problems/solutions, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *