2012-10-22 4 views

답변

1

VBA에서는 TableDefs 및 관계 컬렉션을 사용하여 테이블 및 관계 속성을 표시 할 수 있습니다. ADO 스키마를 사용하여 정보를 얻을 수도 있습니다. 특히

, 당신은 관계의 속성을 참조 할 것 :

Name     Value  Description 
dbRelationDeleteCascade 4096  Deletions cascade 
dbRelationDontEnforce 2   Relationship not enforced (no referential integrity) 
dbRelationInherited  4   Relationship exists in the database containing the two linked tables 
dbRelationLeft   16777216 Microsoft Access only. In Design view, display a LEFT JOIN as the default join type. 
dbRelationRight   33554432 Microsoft Access only. In Design view, display a RIGHT JOIN as the default join type. 
dbRelationUnique  1   One-to-one relationship 
dbRelationUpdateCascade 256   Updates cascade 

http://msdn.microsoft.com/en-us/library/bb225809.aspx

Dim rel As Relation 
Dim tdf As TableDef 

For Each rel In CurrentDb.Relations 
    Debug.Print rel.Attributes 
Next 

4352 = dbRelationUpdateCascade + dbRelationDeleteCascade