[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Dot NET and Access 2000

Thorpe

11/11/2002 3:21:00 PM

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


2 Answers

Ronny Ong

11/14/2002 8:40:00 AM

0

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
>
>


Thorpe

11/14/2002 12:19:00 PM

0

Many thanks this is a great help


"Ronny Ong" <ronnyong@killspam-bigfoot.com> wrote in message
news:OqDe4C7iCHA.1860@tkmsftngp09...
> 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
> >
> >
>
>