Sorry to post this question again.
But now I have another problem

Sub NewRelation()
Dim dbs As DAO.Database, rel As Relation, fld As Field

' Return reference to current database.
Set dbs = CurrentDb
' Create new Relation object and specify foreign table.
Set rel = dbs.CreateRelation("adresse_kunde", _
"t_adresse", "t_kunde")
' Set attributes to enforce referential integrity.
rel.Attributes = dbRelationUpdateCascade And _
dbRelationDeleteCascade
' Create field in Relation object.
Set fld = rel.CreateField("adr_id")
' Specify field name in foreign table.
fld.ForeignName = "adr_nr"
' Append Field object to Fields collection of Relation object.
rel.Fields.Append fld
' Append Relation object to Relations collection.
dbs.Relations.Append rel
dbs.Relations.Refresh
Set dbs = Nothing
End Sub



I have this piece of code and it says to me in the line
dbs.Relations.Append rel

cannot create relation on ODBC Tables

But I can create a relation with the GUI
But i need the creation in code

Has anyone a idea what's going wrong???