Hi all,
I searched the old threads and found this from 2009. I am trying to change the source connection of a linked table through vba. This one is currently set up for an ODBC connection, but the whole tdf.connect part to change which MDB database to use on a network is right over my head.
I'll keep on looking around and post an answer if I find one.
Thanks
I searched the old threads and found this from 2009. I am trying to change the source connection of a linked table through vba. This one is currently set up for an ODBC connection, but the whole tdf.connect part to change which MDB database to use on a network is right over my head.
Code:
Dim myDB As Database, tdf As TableDef
Set myDB = CurrentDb
Set tdf = myDB.TableDefs("dbo_Categories")
tdf.Connect = "ODBC;DRIVER=SQL Server;SERVER=(local);DATABASE=Northwind;Trusted_Connection=Yes"
tdf.RefreshLink
I'll keep on looking around and post an answer if I find one.
Thanks