// the following code requires that the project have a COM reference to:
// "Microsoft Office 14.0 Access Database Engine Object Library"
// create the DBEngine object
var dbe = new Microsoft.Office.Interop.Access.Dao.DBEngine();
// open the local database file containing the linked table
Microsoft.Office.Interop.Access.Dao.Database db = dbe.OpenDatabase(fileNamePainelGerencialTo);
// create a TableDef object for the linked table we want to update
Microsoft.Office.Interop.Access.Dao.TableDef tbd = db.TableDefs["tblPendencia"];
// update the .Connect property with the full path to the remote database
tbd.Connect = ";DATABASE=" + fileNamePainelGerencialPendenciasTo;
// refresh the table link
tbd.RefreshLink();
// create a TableDef object for the linked table we want to update
tbd = db.TableDefs["tblPendenciaBaixa"];
// update the .Connect property with the full path to the remote database
tbd.Connect = ";DATABASE=" + fileNamePainelGerencialPendenciasTo;
// refresh the table link
tbd.RefreshLink();
You can run this VBA as a macro in Access and call this macro by C#
– igventurelli
Thanks man, but I got by the c#
– User