
Refresh linked/imported tables programmatically
For imported tables, the simplest method is using Docmd.TransferDatabase
after deleting the table.
For linked tables, all you have to do is change the table "Connect"
property and then use the "RefreshLink" method. Something like this:
Function RelinkTab (name_tab as String, name_database as String) as
Boolean
Dim td as Tabledef, dbs as Database
'Returns True if there is an error
RelinkTab = True
On Error Goto Lbl_error
'I never know when this is needed; sometimes currentdb is enough
Set dbs = Workspaces(0).Databases(0)
Set td = dbs.Tabledefs(name_tab)
With td
.Connect= <something (1)> & name_database
.RefreshLink
End With
RelinkTab = False
'No error ...
Exit Function
Lbl_error:
' Error condition code ...
End Function
Good luck.
--
Best Regards
J. Mario Pires
---
Please send me a copy by email if you reply to a newsgroup
************
Quote:
> Hi there!
> I am currently working with an Access database that uses linked/imported
> tables from an InterBase database. What I would like to know is: how can I
> programmatically refresh the linked tables and reimport the imported tables
> everytime the database is opened?
> Thanks for any suggestions.
> Pamela