save a table under different name

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

How could I save a table under a different name (without
opening it) from VB to have a copy of the existing table.

Thanks
 
Check Access VB Help on CopyObject Method of the DoCmd Object.
 
How could I save a table under a different name
from VB to have a copy of the existing table.


strSQL = "COPY * " & _
"INTO NewTable " & _
"FROM OldTable "

db.Execute strSQL, dbFailOnError


Strictly speaking, this does not copy the whole object because some
properties like Autoincrement(?), DefaultValue, Required and so on do not
get propagated. Nevertheless, these are not necessary for backing up data,
and there is barely any reason for copying a whole table otherwise.

HTH



Tim F
 

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

Back
Top