Microsoft KB Archive/88651

{|
 * width="100%"|

ACC1x: Practice Using Object Analyzer Commands

 * }

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 &quot;Programming with the Object Analyzer Engine and Utilities.&quot;

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 &quot;Introduction to Programming&quot; manual.

MORE INFORMATION
As discussed in &quot;Programming with the Object Analyzer Engine and Utilities,&quot; 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
 Open the sample database NWIND.MDB and create a new form called Little Analyzer. Add a text box control to the form. Change the ControlName property to Name. Add an option group control called Options to the form.  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  For the AfterUpdate property of the Options option group, specify the following:

=AnalyzeIt(Name, Options) Save and close the form.

Creating a Module
 Open the sample database NWIND.MDB.</li>  Create a new module and type the following function:

<pre class="FIXEDTEXT">     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 &quot;NWIND.MDB&quot;,&quot;@Table&quot;,InName,False Case 2 DumpQueryInfo &quot;NWIND.MDB&quot;,&quot;@QuerySQL&quot;,&quot;@Query&quot;,InName Case 3 DumpFormOrReport &quot;NWIND.MDB&quot;,&quot;@Form&quot;,&quot;@FCtrls&quot;,InName,True Case 4 DumpFormOrReport &quot;NWIND.MDB&quot;,&quot;@Report&quot;,&quot;@RCtrls&quot;,InName,False Case 5 DumpMacroInfo &quot;NWIND.MDB&quot;,&quot;@Macro&quot;,InName Case 6 DumpModuleInfo &quot;NWIND.MDB&quot;,&quot;@Procs&quot;,&quot;@Vars&quot;,InName End Select DoCmd Hourglass False End Function </li> Save and close the module.</li></ol>

Combine Form and Module to Create Object Analyzer

 * 1) Open the Little Analyzer form.
 * 2) In the text box, type Categories.
 * 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

Issue type : kbhowto

Technology :