A process that I am running needs to be able to delete a table and then re-create it with new data. I've recently moved it into a different database that houses all the processes for a particular division in one place. I've been required to have all the tables from the original database set up as linked tables in the new one. Now when it is run, the process deletes the linked table reference and creates a new (un-linked) table inside the new database. I know that I can delete the table through the link, but would I then be able to re-create the table and then re-link it to the new database automatically?
1 Answer
There are a number of ways of linking tables, but you seem to be working purely with MS Access, so DoCmd.TransferDatabase includes Link as one of the options.
4 Comments
Tim
Thank you for your response. Does this also provide the ability to create a new table in the backend? I would need to delete the backend table, re-create it, and then link to it.
Fionnuala
Yes. As I say there are other ways, so you need to pick the one that best suits what you are doing. With the above, you need to use an instance of MS Access to run DoCmd against, you might also like to consider wiki.lessthandot.com/index.php/Linking_Tables_via_Jet_and_ADO
Fionnuala
You can also use DAO with dbengine to manipulate and create TableDefs.
BarclayVision
very old post but wondering if linking can be done without ADOX? Don't have direct access to the 'access database' need to do via code. I do have interop.ado.dll on web server not adox.dll (Also I'm working from a Mac so don't have visual studio or other means to get ell file I would need...