O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

D.2. Undocumented Tools and Resources

Several Access-specific utilities and object methods are shipped with Microsoft Access 2007. These utilities and methods are not very well documented by Microsoft or are not documented at all. Nonetheless, you can use them to help you develop and maintain your DAO applications.

D.2.1. Utilities ISAMStats

Microsoft Access 2007 contains an undocumented DBEngine method called ISAMStats, which returns various internal statistics. You use ISAMStats to get statistics about different operations. For example, to determine which of several queries will run faster, you can use ISAMStats to return the number of disk reads performed by each query.

Each of the ISAMStats options maintains a separate statistics counter that records the number of times its metric occurs. To reset the counter, set the Reset argument to True. The syntax is as follows:

lngReturn = DBEngine.ISAMStats(StatNum [, Reset])

where StatNum is one of the following values:

StatNum ValueDescription
0Number of disk reads.
1Number of disk writes.
3Number of reads from cache.
4Number of reads from read-ahead cache.
5Number of locks placed.
6Number of locks released.

You must call ISAMStats twice: once to get a baseline statistic and once (after the operation to be analyzed) to get the final statistic. Then you subtract the baseline statistic from the final one to arrive at the statistic for the operation under test. The following examples demonstrate two ways to use ISAMStats:

D.2.1.1. Method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required