Change linked table connection string with code (1 Viewer)

Chisamba

Registered User.
Local time
Today, 22:51
Joined
Jul 10, 2006
Messages
12
I would like to use code to change the connection string for linked tables in my front end database. I have tried using the connection property of the TableDefs collection, this seems to work while I step through the code but does not change the existing connection property. Any suggestions?
 

ByteMyzer

AWF VIP
Local time
Today, 12:51
Joined
May 3, 2004
Messages
1,409
When changing the connection string of a linked table, you must then refresh the link. For example:
Code:
td.Connect = "MS Access;Database=C:\MyBackEnd.mdb;"
td.RefreshLink
The RefreshLink command commits the change to the connection string.
 

Chisamba

Registered User.
Local time
Today, 22:51
Joined
Jul 10, 2006
Messages
12
Thanks a lot.
 

Users who are viewing this thread

Top Bottom