Change Link Table to Local Table With VBA

G

Guest

I have a linked table with SQL Server. I can click Edit, Copy, Paste and get
a choice of whether to create a linked or local table. Is there a way to
accomplish the same thing through VBA ? I found the copy command:

DoCmd.CopyObject , "Customers_bk", acTable, "Customers"

But it does not give the option to change to a local table as in the cut and
paste.
 
J

John Nurick

You'll need to write code to delete the linked table and import the data
to a new local table.
 
D

david epsom dot com dot au

You can use a Create Table query to copy the linked table
to a new local table.

You can create the "Create Table" query in the Query Design
View, and save it.

Then you can run the query from VBA

Or you can look at the SQL view of the query, and use
that to create a New SQL on the fly in VBA.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top