help with querying system tables for meta data.

W

Will

Can some one advise on what tables and fields need to be queried in order to
determine what referential constraints are on a table. This would encompass
the cascade, be it delete and or update of course and the name of the child
table.


Thank you most kindly,

Will
 
A

Allen Browne

This code shows how to loop through the Relations collection to determine
the tables involved in the relationship, and how the fields relate.

Examine the Attributes property to determine whether referential integrity
is enforced, and whether any cascades apply.

Function ShowRel()
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field

Set db = CurrentDb()
For Each rel In db.Relations
Debug.Print rel.Name, rel.Table, rel.ForeignTable, rel.Attributes
For Each fld In rel.Fields
Debug.Print , fld.Name, fld.ForeignName
Next
Next

Set fld = Nothing
Set rel = Nothing
Set db = Nothing
End Function
 
Top