VB Code to copy linked table to local

J

JD

I have an Access 2007 database with a linked ODBC table that changes on a
daily basis. I want to automate a function where the linked table is copied
and pasted as a local table. I tried the following command:

DoCmd.CopyObject , stNewName, acTable, stTblName

It worked, and named the new table correctly (based on an earlier command
that assigns the table name with the current date as "stNewName"), but it
stayed as a linked table - which means tomorrow, today's data will be lost.
Is there a parameter of the CopyObject command that will make the new table
local, or is there another command I should be using?
 
K

kc-mass

Why not use a MakeTable query to create your file.

Something like :

SELECT tblLinkedTable.* INTO tblCopyOfLinkedFile
FROM tblLinkedTable;

If you use VBA can can easily embed the date in the target filename so
each day's will be retained and ID'd.

Regards

Kevin
 
D

Daniel Pineault

J

JD

Thanks for the help. It seems to me that based on the suggestions I've read,
the easiest solution will be to simply copy the table and paste it to a new
local table.
 
S

Stefan Hoffmann

hi JD,

It worked, and named the new table correctly (based on an earlier command
that assigns the table name with the current date as "stNewName"), but it
stayed as a linked table - which means tomorrow, today's data will be lost.
Is there a parameter of the CopyObject command that will make the new table
local, or is there another command I should be using?
See

http://msdn.microsoft.com/en-us/library/bb214131.aspx

DoCmd.TransferDatabase acImport, ....


It's faster then using SELECT * INTO localTable FROM linkedTable.


mfG
--> stefan <--
 
T

tom_willpa

high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
 

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