1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Public Sub ChampsDansRelation()
Dim wrk As DAO.WorkSpace, odb As DAO.Database, oRlt As DAO.Relation, oFld As DAO.Field
Dim FSO As New Scripting.FileSystemObject, FileText As Scripting.TextStream
100 Set wrk = DBEngine.Workspaces(0)
102 Set odb = wrk.OpenDatabase( "nomcompletdemadorsale.mdb", False, False, "MS Access;PWD=xxx")
105 Set FileText = FSO.OpenTextFile("liste_relations.txt", ForWriting, True)
106 For Each oRlt In odb.Relations
110 For Each oFld In oRlt.Fields
112 If Left(oRlt.Name, 1) = "{" Then
114 odb.Relations.Refresh
End If
119 FileText.WriteLine Left(oRlt.Name & " ", 28) & "= " & Left(oRlt.table & "." & oFld.Name & " ", 20) & "> " & oRlt.ForeignTable & "." & oFld.ForeignName
Next oFld
Next oRlt
132 FileText.Close: Set FileText = Nothing
134 Set FSO = Nothing
136 Shell "notepad.exe " & Client_path & "R_" & Planet_cli & ".txt"272 Set wrk = Nothing
End Sub |
Partager