1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| 'Génère les directives pour Graphviz dans la fenêtre d'exécution
Sub GV_Directives()
Dim dbc As dao.Database: Set dbc = CurrentDb
Dim rel As dao.Relation
Dim strAttrib As String, strRelName As String
Dim lngNbRel As Long, lngNbDel As Long, lngDeb As Long
For Each rel In dbc.Relations
strAttrib = vbNullString
lngDeb = InStr(1, rel.Name, "tbl")
If lngDeb > 0 Then 'C'est une table utilisateur
strRelName = Mid$(rel.Name, lngDeb) 'Shunt du préfixe si recherche dans back-end à partir du front-end
lngNbRel = lngNbRel + 1 'Compteur de relations
If rel.Attributes >= dbRelationDeleteCascade Then
strAttrib = " [style=filled]"
lngNbDel = lngNbDel + 1 'Compteur des contraintes ayant l'option Delete
End If
Debug.Print rel.Table & " -> " & rel.ForeignTable & strAttrib
End If
Next rel
MsgBox lngNbRel & " relations dont " & lngNbDel & " DeleteCascade"
dbc.Close: Set dbc = Nothing
End Sub |
Partager