hello , I did add one line to this code to delete the connection. Here you will find the code to add a ODBC table connection to DSN. DSN connects to SQL Server, Oracle, etc. As long as the DSN is setup correctly, it will work. You can cut and pasted the below code into your code
good luck
Function LinkFromDNSConnection(Optional StrLocation As String = StrSQLServerConnect, Optional StrSourceTable As String = "CMDATA_Invalid_Records_Pass1", Optional StrDestinationTable As String = "CMDATA_Invalid_Records_Pass1"

'***********************************************************
'*
'* Purpose : Link Tables from SQL Server to current database
'* StrLocation = Connection String
'* StrSourceTable = Table name in the DSN location
'* StrDestinationTable = Table name that access is going to name it.
'*Global Const StrSQLServerConnect As String = "ODBC;DATABASE=PropertyListing;" & _
"UID=LinknPropertyMaster;" & _
"PWD=LinknPropertyMaster;" & _
"DSN=LinknPropertyMaster"
'***********************************************************
Dim db As Database
Dim td As TableDef 'Holds the table definition
Set db = CurrentDb
Set td = db.CreateTableDef(StrDestinationTable)
td.Connect = StrOracleConnect
td.SourceTableName = StrSourceTable
'td.SourceTableName = "cmdata_199911"
db.TableDefs.Append td
db.TableDefs.Delete td
End Function