Documenting the relationship between objects in a DB

  • Thread starter Thread starter Gus
  • Start date Start date
G

Gus

Is there a way in Access (or a freeware utility) that
allows me to view the relationship between objects (i.e.
which queries a form is using, etc.)? I've tried the
Analyzer-Documentor, but it's not really helping.

THanks!
 
Create a table with
QueryName Text | Composite Keys
ParentName Text |
ParentType Number

Then you can run this subroutine....


The report will be on you then.



Sub FindQueryStructure()

Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim fld As DAO.Field
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intFrom As Integer
Dim intWhere As Integer

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Select Name,type from
MSYSOBJECTS where TYpe in(5,6,1)")
For Each qdf In dbs.QueryDefs
strSQL = qdf.SQL
rst.MoveFirst
Do Until rst.EOF
If InStr(qdf.SQL, rst(0)) > 0 Then
CurrentDb.Execute "Insert Into
tblQueryStructure(QueryName,ParentName,parentType) values
('" & qdf.Name & "','" & rst("Name") & "'," & rst("Type")
& ")"
End If
rst.MoveNext
Loop
Next qdf

End Sub
 
Back
Top