I\'m Having problems getting Access (2010) VBA to trap errors for connections to a SQL Server (2008) for linking tables.
I\'m getting an error and popup windows, presuma
The error will not occur until you try to append the TableDef
Dim myDB As DAO.Database
Dim myTabledef As DAO.TableDef
On Error GoTo Err_handler
Set myDB = CurrentDb
scn = "odbc;driver=SqLServer;" & _
"DATABASE=myDB;SERVER=myServer;Trusted_Connection=Yes;"
Set myTabledef = myDB.CreateTableDef("l_table")
myTabledef.Connect = scn
myTabledef.SourceTableName = "Table1"
myDB.TableDefs.Append myTabledef
Err_handler:
Debug.Print Err.Number & " " & Err.Description