ACC1x: How to Make the Analyzer Include Field DescriptionsID: Q109404
|
The Object Analyzer utility that comes with Microsoft Access does not include field descriptions in its output. However, you can make the Analyzer include field descriptions by making some modifications to the utility.
To make the Analyzer include field descriptions in its output you need to
modify the table RLTables and the function DumpTableInfo() in the
ANALYZER.MDA library.
The following steps describe how to make the necessary modifications:
analyzer.mda=
exists in the [Libraries] section of the MSACCESS.INI file, put a
semicolon at the beginning of the line. The modified line will be:
;analyzer.mda=
Sub DumpTableInfo (TargetDB As String, SQLTarget1 As String, _
ObjOption As String, IsAttached As Integer)
CurrentProc = "DumpTableInfo"
'$$ New code begins - declare new variables
Dim F As Form, C As Control
'$$ New code ends
If Not TableExists(TargetDB, SQLTarget1) Then
'$$ New code begins - change the SQL to include Description
SQLSTRING$ = "Select TableName,Name,Type,Length,IndexName,_
Description Into [" & SQLTarget1 & "] in """ & TargetDB _
& """ From RLTables;"
'$$ New code ends
PerformSQLAction SQLSTRING$
End If
Set RT_Target = OpenDatabase(TargetDB)
Set RT_Database = CurrentDB()
Set RT_SysDB = CodeDB()
Set RT_Table2 = RT_Target.OpenTable(SQLTarget1)
Set RT_Dynaset1 = RT_Database.CreateDynaset(ObjOption)
Set RT_Snapshot1 = RT_Dynaset1.ListFields()
If Not IsAttached Then
Set RT_Table1 = RT_Database.OpenTable(ObjOption)
Set RT_Snapshot2 = RT_Table1.ListIndexes()
End If
'$$ New code begins - create a form in Design view
Set F = CreateForm()
'set the record source to the source table
F.RecordSource = ObjOption
'$$ New code ends
Do Until RT_Snapshot1.EOF
RT_Table2.AddNew
RT_Table2!TableName = ObjOption
RT_Table2!Name = RT_Snapshot1!Name
RT_Table2!Type = LookUpFieldType(RT_Snapshot1!Type)
RT_Table2!Length = RT_Snapshot1!Size
'$$ New code begins - create a control for this field
Set C = CreateControl(F.FormName, 109, 0, "", RT_Snapshot1!Name)
'save the description from the field
RT_Table2!Description = C.StatusBarText
'$$ New code ends
If Not IsAttached Then
' Cannot use FindFirst method on List Snapshots
If RT_Snapshot2.RecordCount > 0 Then
RT_Snapshot2.MoveFirst
Do Until RT_Snapshot2.EOF
If RT_Snapshot2!FieldName = RT_Snapshot1!Name Then _
Exit Do
RT_Snapshot2.MoveNext
Loop
If Not RT_Snapshot2.EOF Then
RT_Table2!IndexName = RT_Snapshot2!IndexName
End If
End If
End If
RT_Table2.Update
RT_Snapshot1.MoveNext
Loop
'$$ New code begins - close the form, say "No" to save changes
DoCmd SetWarnings True
SendKeys "n"
DoCmd Close A_FORM, F.FormName
'$$ New code ends
RT_CloseAllObjects
End Sub
;analyzer.mda=
line in the [Libraries] section of the file. The modified line will
be:
analyzer.mda=
For more information about the Object Analyzer, see the ANALYZER.TXT file that comes with Microsoft Access version 1.1 or the README.TXT file that comes with Microsoft Access version 1.0.
Additional query words:
Keywords : kbusage
Version : WINDOWS:1.0,1.1
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: July 13, 1999