Documenting the relationship between objects in a DB

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!
 
C

Chris Nebinger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top