Ronny Ong
11/14/2002 8:40:00 AM
In theory, you can use COM Interop to instantiate Access.Application and
call the RunCommand method with the acCmdLinkedTableManager parameter, but
there are two big problems with this approach:
(1) You can download Primary Interop Assemblies for Access 2002 and Office
XP, but Microsoft doesn't officially support COM Interop from .NET to Access
2000. It can work, but isn't considered stable/reliable.
(2) Running the Linked Table Manager is a horrible way of programmatically
refreshing links because it relies on a user interface which you will need
to automate via SendKeys after you open it with RunCommand.
You really need to use DAO (Data Access Objects) through COM Interop. In
DAO, open the database and loop through its TableDefs collection. If a
TableDef has a Connect property, then it is a linked table. Set the Connect
property to whatever it needs to be, then call the RefreshLink method to
update the TableDef.
"Thorpe" <p_wyatt@hotmail.com> wrote in message
news:eJ0qU0YiCHA.1544@tkmsftngp09...
> I have an access database that has a Linked table to another database
table.
> Is it at all possible to write a dotnet application (c#) that can
> automatically run the Linked table Manager in Access to update the Linked
> table.
>
> cheers
>
>