C.3. Undocumented Tools and Resources

There are several Jet-specific utilities and object methods that are shipped with Microsoft Access 2003. These utilities and methods are either not very well documented by Microsoft or not documented at all. Notwithstanding, you can use them to help you develop and maintain your DAO applications.

C.3.1. Utilities

C.3.1.1. ISAMStats

Microsoft Jet 4.0 contains an undocumented DBEngine method called ISAMStats, which returns various internal statistics. You use ISAMStats to get statistics about different operations. For example, if you want 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:

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. You then subtract the baseline statistic from the final one, to arrive at the statistic for the operation under test. The following example demonstrates two ways to use ...

Get Access 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.