ACC1x: Practice Using Object Analyzer Commands

Last reviewed: June 6, 1997
Article ID: Q88651
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SUMMARY

This article provides an example of how to use the Object Analyzer commands discussed in the article titled "Programming with the Object Analyzer Engine and Utilities."

This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual.

MORE INFORMATION

As discussed in "Programming with the Object Analyzer Engine and Utilities," you can take advantage of the Object Analyzer engine by using the commands in the Object Analyzer module.

To create your own Database Analyzer, follow these steps.

Creating a Form

  1. Open the sample database NWIND.MDB and create a new form called Little Analyzer.

  2. Add a text box control to the form. Change the ControlName property to Name.

  3. Add an option group control called Options to the form.

  4. Add six toggle buttons to the Options option group and modify the properties of the toggle buttons as described below:

          Control         Option Value   Caption
          --------------------------------------
    
          First Button          1        Table
          Second Button         2        Query
          Third Button          3        Form
          Fourth Button         4        Report
          Fifth Button          5        Macro
          Sixth Button          6        Module
    
    

  5. For the AfterUpdate property of the Options option group, specify the following:

           =AnalyzeIt(Name, Options)
    

  6. Save and close the form.

Creating a Module

  1. Open the sample database NWIND.MDB.

  2. Create a new module and type the following function:

          Function AnalyzeIt (InName As String, InType As Integer)
          ' This function accepts the name of a Microsoft Access object
          ' and a number representing what type of object it is, then uses
          ' the Object Analyzer Dump commands to analyze the object.
    

          DoCmd Hourglass True
          Select Case InType
    
             Case 1
                DumpTableInfo "NWIND.MDB","@Table",InName,False
             Case 2
                DumpQueryInfo "NWIND.MDB","@QuerySQL","@Query",InName
             Case 3
                DumpFormOrReport "NWIND.MDB","@Form","@FCtrls",InName,True
             Case 4
                DumpFormOrReport "NWIND.MDB","@Report","@RCtrls",InName,False
             Case 5
                DumpMacroInfo "NWIND.MDB","@Macro",InName
             Case 6
                DumpModuleInfo "NWIND.MDB","@Procs","@Vars",InName
          End Select
          DoCmd Hourglass False
          End Function
    
    

  3. Save and close the module.

Combine Form and Module to Create Object Analyzer

  1. Open the Little Analyzer form.

  2. In the text box, type "Categories" (without the quotation marks).

  3. Choose the Tables button. You have created an Object Analyzer.

    The Object Analyzer analyzes the Categories table and creates a table called @Table, which contains information about the structure of the Categories table.

If you have the Database Analyzer library loaded, you can use these commands to build your own object-analysis tool, or you can incorporate these commands into your application to make it self-documenting.


Keywords : kbprg PgmOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : x86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 6, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.